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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

{Apache 2.0} breaks the page #1196

Closed
damithc opened this issue Apr 11, 2020 · 5 comments
Closed

{Apache 2.0} breaks the page #1196

damithc opened this issue Apr 11, 2020 · 5 comments

Comments

@damithc
Copy link
Contributor

damithc commented Apr 11, 2020

Funny thing: If I put the text {Apache 2.0} in a page, it breaks 馃 ({2} breaks it too)

image

@ang-zeyu
Copy link
Contributor

Where was this placed?
markdown-it-attrs would recognise single curly braces as "attributes", though I'm not so sure how it breaks the page

For a workaround could try <span>{</span>apache 2.0<span>}</span> temporarily
A permanant component to "escape everything and have it show in the browser" is in the works #1049 (comment)

@damithc
Copy link
Contributor Author

damithc commented Apr 11, 2020

Putting it in any page in the CS2113 website seems to break the page. Only certain cases break. e.g., {abc} does not cause problems.
Thanks for the workaround. It's fine if the fix is on the way.

@ang-zeyu
Copy link
Contributor

investigated it a little more just to be sure;

the html generated is as expected from markbind's standpoint; it only breaks when there are numbers as starting characters of the attributes e.g. 2.0 in apache 2.0 or 2, which isn't allowed by the browser

<p apache="" 2.0=""></p>

will close this since the problem is the same as #762 otherwise

@damithc
Copy link
Contributor Author

damithc commented Apr 12, 2020

will close this since the problem is the same as #762 otherwise

Not quite the same though, at least from the author POV. Nunjucks doesn't have a {x} syntax (it uses double braces). So, the author will not realize the text is likely to cause problems. We often use { abc } as placeholders in document templates e.g., {your product name here}

@ang-zeyu
Copy link
Contributor

ahh ok, the solution to both the problems would be the same though ( some sort of <escape>...</escape> component )
Since markdown-it-attrs isn't mentioned explicitly in the ug, we could particularly highlight this in #1106 meanwhile

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

No branches or pull requests

2 participants