Adding support for RTL languages for readme markdown preview. (#139644)

* [markdown preview] dir "auto" added to the markdown-body class.

* fix markdown preview for RTL languages
This commit is contained in:
Mohammad Sadegh Salimi
2022-01-06 01:44:32 +03:30
committed by GitHub
parent 883009bf0f
commit 2a0d371ca3
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ const pluginSourceMap: MarkdownIt.PluginSimple = (md): void => {
if (token.map && token.type !== 'inline') {
token.attrSet('data-line', String(token.map[0]));
token.attrJoin('class', 'code-line');
token.attrJoin('dir', 'auto');
}
}
});
@@ -178,7 +179,7 @@ export class MarkdownEngine {
return engine.parse(text.replace(UNICODE_NEWLINE_REGEX, ''), {});
}
public resetSlugCount(): void {
this._slugCount = new Map<string, number>();
}