Skip to content
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

Closed
j-mie6 opened this issue Jun 24, 2023 · 4 comments · Fixed by #18079
Closed

Scaladoc3 does not render wiki syntax italics #18051

j-mie6 opened this issue Jun 24, 2023 · 4 comments · Fixed by #18079
Assignees
Milestone

Comments

@j-mie6
Copy link

j-mie6 commented Jun 24, 2023

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 as hi but without italics.

Expectation

With wiki syntax enabled, ''hi'' should behave the same as *hi*, _hi_ in markdown syntax.

@j-mie6 j-mie6 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 24, 2023
@odersky odersky added area:doctool and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 24, 2023
@Dedelweiss
Copy link
Contributor

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.

@j-mie6
Copy link
Author

j-mie6 commented Jun 27, 2023

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)

@j-mie6
Copy link
Author

j-mie6 commented Jun 27, 2023

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

@Dedelweiss
Copy link
Contributor

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.

bishabosha added a commit that referenced this issue Jun 28, 2023
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
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants