-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Scaladoc3 does not render wiki syntax italics #18051
Comments
Hi @j-mie6, thank you for the Issue. I did a PR on the problem but with the "-comment-syntax:wiki" flag because I couldn't find "-doc-syntax:wiki" and that's the one that's closest to what you want. |
Ah yes, you're right about the flag name, my mistake! (To be clear, this is the one I was using just wrote it down wrong in the issue) |
as an aside @Dedelweiss, any reason why this works for the markdown syntax but not the wiki one? I would have assumed they shared code |
Hello @j-mie6, that's a good question. I don't want to say anything wrong, but it seems to me that in the DocRenderer.scala file the code provides for separate management of Markdown syntax and Wiki syntax during the rendering process. The renderMarkdown function is responsible for rendering Markdown syntax. It takes an MdNode as input and uses the DocFlexmarkRenderer to render the Markdown content. The renderElement function is responsible for rendering Wiki syntax. It takes a WikiDocElement as input and performs various rendering operations depending on the type of element. In the renderDocPart function, the renderMarkdown function is called when the input document is an MdNode, while the renderElement function is called when the input document is a WikiDocElement. |
The purpose of this PR is to correct the style of wiki syntax when the -comment-syntax:wiki option is enabled. There are 2 possibilities: - First, change the tag (done in this PR): So when the correct syntax is called up, I change the tag to strong, em, etc... instead of using a span with a class. - Second, change the CSS: We keep the span with a class and add the correct CSS associated with the class. ### Code: <img width="399" alt="Screenshot 2023-06-27 at 16 01 31" src="https://github.com/lampepfl/dotty/assets/44496264/e75ba21f-03f5-40b2-8ce5-4356e9b933f4"> ### Before: <img width="1920" alt="Screenshot 2023-06-27 at 16 03 30" src="https://github.com/lampepfl/dotty/assets/44496264/958bd703-4570-402a-808c-5700a0a203fe"> ### After: <img width="1920" alt="Screenshot 2023-06-27 at 16 01 34" src="https://github.com/lampepfl/dotty/assets/44496264/35a3facb-1538-4fe0-b6ed-1bcda0e8f534"> Fix: #18051
Compiler version
3.3.0
The
--doc-syntax:wiki
flag, or alternatively@syntax wiki
can be used to tell scaladoc3 to render with the old scaladoc2-style wiki syntax instead of markdown. However, while*hi*
or_hi_
works with markdown syntax,''hi''
does nothing with wiki syntax: with markdown syntax turned on it will literally render as''hi''
, and with wiki syntax on it will render ashi
but without italics.Expectation
With wiki syntax enabled,
''hi''
should behave the same as*hi*
,_hi_
in markdown syntax.The text was updated successfully, but these errors were encountered: