-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix markdown preview $$ support #31514
Fix markdown preview $$ support #31514
Conversation
I guess we shouldn't introduce too much copy&pasted code ........ |
b42d294
to
f347858
Compare
Removed some duplicate code. |
if _, ok := n.(*InlineBlock); ok { | ||
_, _ = w.WriteString(`<pre class="code-block is-loading"><code class="chroma language-math display">`) | ||
} else { | ||
_, _ = w.WriteString(`<code class="language-math is-loading">`) |
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 could be <code class="language-math is-loading {{some-extra-class-for-inline-or-not}}">
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 could be
<code class="language-math is-loading {{some-extra-class-for-inline-or-not}}">
is-loading
is not a common code
attribute in this case, and the class order can't be changed. If we need to change the order, we might need to update the rule in sanitizer_default.go.
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.
My intuition is that single <code>
is good enough and more maintainable/consistent, while I won't block the two tags.
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.
I think the only reason for two tags is semantical correctness.
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.
I used two tags to keep the same style as the block render for the $$
block, but one code
tag also works.
I have updated it to the one code
tag version.
a288b49
to
650fbd3
Compare
650fbd3
to
1a85932
Compare
close #31481
currently
$$A + B$$ test
will ignore text after $$ blocktest text
before fix
after fix
github display