-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for RTL languages for readme markdown preview. #139644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one question if we can get away with just setting it on the top level element
@@ -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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required or is dir
inherited by child elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is required. Because dir="auto"
just looks at the first paragraph and apply direction to all the child element.
Childs just inherit rtl
or ltr
. Childs doesn't inherit auto
and it is not so smart.
I think we can only add dir="auto"
to the code-line
classes (childs). But for markdown-body
class is optional.
@@ -178,7 +179,7 @@ export class MarkdownEngine { | |||
|
|||
return engine.parse(text.replace(UNICODE_NEWLINE_REGEX, ''), {}); | |||
} | |||
|
|||
public resetSlugCount(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we have an empty extra line here.
Thanks! Will be in the next VS Code insiders build and scheduled to be released as part of VS Code 1.64 |
This PR fixes #139643
I'm solving this issue as a good-first-issue. If you think anything is wrong please help me to solve it. :)