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

'@' in code blocks causes crash #2

Closed
vratojr opened this issue Sep 2, 2019 · 4 comments
Closed

'@' in code blocks causes crash #2

vratojr opened this issue Sep 2, 2019 · 4 comments

Comments

@vratojr
Copy link

vratojr commented Sep 2, 2019

Hello,
If I write a comment like:

/**
* ````java
* @Entity
* ````
*/

The '@' inside the blocks is not ignored and so it tries to map it to a know tag, failiing.
It just issues a
warning - @Entity is an unknown tag.
but the document generation stops.

If I use a workaround like:

* ````java
* \@Entity
* ````

Everything works but the the '' is rendered.

PS: Great work!

@mnlipp
Copy link
Owner

mnlipp commented Sep 2, 2019

The proper way to escape a '@' is by using "{@literal @}". It will prepend a space for some reason, but I think that's acceptable.

As to whether javadoc tags in backquote sections should be processed or not, opinions may
differ. I don't think I'm going to change the current behavior.

@vratojr
Copy link
Author

vratojr commented Sep 2, 2019

Thanks.

@vratojr vratojr closed this as completed Sep 2, 2019
@Clashsoft
Copy link

Clashsoft commented Dec 11, 2020

Running into the same problem, but I think the behaviour of processing tags within code blocks is quite unintuitive. Is there a situation in which that could be useful? Imo, the whole point of using the Markdown doclet is to make the Javadocs more easy to read and write. Having to write {@literal @} sort of goes against that.

@mnlipp
Copy link
Owner

mnlipp commented Dec 11, 2020

It's hard to change this due to the way mdoclet is implemented. The standard doclet wasn't really designed for extensibility. mdoclet kind of "hooks" into the processing but only gets input which is already preprocessed.

Things will have to be done very differently with the new (> Java8) javadoc anyway. I have this on my ToDo list, but neither is this list short nor is mdoclet currently at the top. I suppose it will rise as I get more and more projects for which I have to maintain the Java8 configuration only to be able to run javadoc ;-)

A first glance at the "new" javadoc showed an architecture that is even less suited for extensions than the previous one. That's why much bigger projects such as asciidoclet are [still struggling}(https://github.com/asciidoctor/asciidoclet/issues/71) with this years after Java9 came out. I'm actually very much afraid that whoever wants to write doclets for > Java8 has to re-implement the standard doclet completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants