-
Notifications
You must be signed in to change notification settings - Fork 1.1k
macros.md: Fix htmlized variant of first source code example #12732
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
macros.md: Fix htmlized variant of first source code example #12732
Conversation
Confusingly, the last part of the first source code example would appear as def showExpr(expr: Expr[Boolean])(using Quotes): Expr[String] = '{ " " } in the htmlized version of the markdown documentation source. Which reads as follows: def showExpr(expr: Expr[Boolean])(using Quotes): Expr[String] = '{ "<some source code>" } // Better implementation later in this document This seems to be cause by the usage of angle brackets. Also note that the code comment does not appear in the htmlized output.
@@ -40,7 +40,7 @@ def assertImpl(expr: Expr[Boolean])(using Quotes) = '{ | |||
} | |||
|
|||
def showExpr(expr: Expr[Boolean])(using Quotes): Expr[String] = | |||
'{ "<some source code>" } // Better implementation later in this document | |||
'{ [actual implementation later in this document] } |
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.
'{ [actual implementation later in this document] } | |
'{ /* actual implementation later in this document */ } |
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.
That will also be eaten by whatever tool transforms the markdown to HTML, just as the other comment (probably all valid Scala comments?). I've no idea why a markdown-to-HTML converter would do that…
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.
Handling of angle brackets in code blocks is mangled by scala style at #12734
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.
Probably, it is very common for Markdown code comments to require special handling of angle brackets. But I am talking about code comments, i.e. the \\ comment
and /* comment */
which simply disappear in the htmlized output.
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.
To confirm, if you remove scala
from the triple-backticks, the angle brackets render correctly.
'{ "<some source code>" } // Better implementation later in this document
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.
Otherwise it xmlifies as
</span><span id="11" class=""> '{ "
<some source code>
" }
<span class="hideable">// Better implementation later in this document</span>
</some></span><pre></pre></code></pre>
Apologies if this was already discussed elsewhere, just mentioning what I noticed this morning.
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.
The current version makes it readable. We can change it later if we want when the underlying issue is fixed.
Confusingly, the last part of the first source code example would
appear as
def showExpr(expr: Expr[Boolean])(using Quotes): Expr[String] =
'{ "
in the htmlized version of the markdown documentation source. Which
reads as follows:
def showExpr(expr: Expr[Boolean])(using Quotes): Expr[String] =
'{ "" } // Better implementation later in this document
This seems to be cause by the usage of angle brackets. Also note that
the code comment does not appear in the htmlized output.