jakartaee / jakartaee-tutorial

Jakarta EE Tutorial Content
https://jakartaee.github.io/jakartaee-documentation/jakartaee-tutorial/current/
Eclipse Public License 2.0
15 stars 21 forks source link

Escape EL expressions #73

Closed BalusC closed 7 months ago

BalusC commented 8 months ago

Ensure that all EL expression examples in template text are properly escaped because Antora otherwise misinterprets the # as the start of a highlight, or the {name} as a reference, in spite of them being marked up as code using backticks.

One example is https://jakartaee.github.io/jakartaee-documentation/jakartaee-tutorial/current/web/webapp/webapp.html#_the_view image

The #{hello.name} is incorrectly highlighted. The #{hello.greeting} is incorrectly missing the #. The solution is to replace # by its HTML entity derivate &35;. Even though it appears to happen only when one sentence contains at least two of these EL expressions, I've for safety and clarity replaced all occurrences.

The #{hello} form is via {hello} also interpreted as a reference. Antora will emit warnings on these like below:

skipping reference to missing attribute: hello

The solution is to escape { by \{. This is however not applicable when the name has a . such as #{hello.name}.

kito99 commented 8 months ago

@BalusC I'm not seeing this problem here: https://jakartaee.github.io/jakartaee-documentation/jakartaee-tutorial/current/web/faces-el/faces-el.html#_immediate_evaluation. What am I missing?

BalusC commented 8 months ago

The problem only manifests when # appears at least twice in a paragraph, as said:

Even though it appears to happen only when one sentence contains at least two of these EL expressions, I've for safety and clarity replaced all occurrences.

See also https://docs.antora.org/antora/latest/asciidoc/highlight/

kito99 commented 8 months ago

Ah, ok. Can you also update the contribution guide?


Kito D. Mann https://kitomann.com/ | @kito99 https://twitter.com/kito99 | Java Champion | Google Developer Expert Alumni | LinkedIn https://www.linkedin.com/in/kitomann/ Expert consulting and training: Cloud architecture and modernization, Java/Jakarta EE, Web Components, Angular, Mobile Web Virtua, Inc. | virtua.tech +1 203-998-0403 <(203)%20998-0403> http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403 http://voice.google.com/calls?a=nc,%2B12039980403

From: Bauke Scholtz @.> @.> Reply: jakartaee/jakartaee-tutorial @.> @.> Date: November 6, 2023 at 10:31:12 AM To: jakartaee/jakartaee-tutorial @.> @.> CC: Kito D. Mann @.> @.>, Review requested @.> @.> Subject: Re: [jakartaee/jakartaee-tutorial] Escape EL expressions (PR #73)

The problem only manifests when # appears at least twice in a paragraph, as

said:

Even though it appears to happen only when one sentence contains at least two of these EL expressions, I've for safety and clarity replaced all occurrences.

See also https://docs.antora.org/antora/latest/asciidoc/highlight/

— Reply to this email directly, view it on GitHub https://github.com/jakartaee/jakartaee-tutorial/pull/73#issuecomment-1795106865, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYKGURP4BCSOWQ4NKZKWB3YDD7EBAVCNFSM6AAAAAA66MAUS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJVGEYDMOBWGU . You are receiving this because your review was requested.Message ID: @.***>