mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 12:47:48 +00:00
fix: escape symbols in the samples lang name (#703)
Co-authored-by: Anton Kozachuk <antonkozachuk@Antons-MacBook-Pro.local>
This commit is contained in:
@@ -74,6 +74,13 @@ export function pathToFilename(path: string, pathSeparator: string) {
|
||||
.replace(/\//g, pathSeparator);
|
||||
}
|
||||
|
||||
export function escapeLanguageName(lang: string) {
|
||||
return lang
|
||||
.replace(/#/g, "_sharp")
|
||||
.replace(/\//, '_')
|
||||
.replace(/\s/g, '');
|
||||
}
|
||||
|
||||
export class CircularJSONNotSupportedError extends Error {
|
||||
constructor(public originalError: Error) {
|
||||
super(originalError.message);
|
||||
|
||||
Reference in New Issue
Block a user