Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Comments

Fix bug 1335006#108

Closed
a2sheppy wants to merge 2 commits intomdn:masterfrom
a2sheppy:Bug1335006-fix-jsxref
Closed

Fix bug 1335006#108
a2sheppy wants to merge 2 commits intomdn:masterfrom
a2sheppy:Bug1335006-fix-jsxref

Conversation

@a2sheppy
Copy link
Contributor

@a2sheppy a2sheppy commented Feb 7, 2017

Change jsxref macro to use <%- %> for the displayed text, so that special
characters like "<" and ">" draw correctly instead of showing up as "<"
etc.

Change jsxref macro to use <%- %> for the displayed text, so that special
characters like "<" and ">" draw correctly instead of showing up as "&lt;"
etc.
@jwhitlock
Copy link
Contributor

jwhitlock commented Feb 8, 2017

The text should be not be escaped if the <code> block is included (the default), and escaped if it is not included. I would expect:

{{jsxref("Ops", "<", "#Less_than_operator")}}
{{jsxref("Ops", "<", "#Less", false)}}

to produce:

<a href="/en-US/docs/Web/JavaScript/Reference/Ops#Less" title="JavaScript has ..."><code>></code></a>
<a href="/en-US/docs/Web/JavaScript/Reference/Ops#Less" title="JavaScript has ...">&amp;lt;</a>

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think John's proposal makes sense. Setting "request changes".

Copy link
Contributor

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run this locally:

jsxref 1: {{jsxref("Ops", ">", "#Less_than_operator")}}

jsxref 2: {{jsxref("Ops", ">", "#Less", 0)}}

I get the following HTML:

<p>jsxref 1: <a title="The documentation about this has not yet been written; please consider contributing!" class="new" href="/en-US/docs/Web/JavaScript/Reference/Ops#Less_than_operator"><code>
&gt;
</code></a></p>
<p>jsxref 2: <a title="The documentation about this has not yet been written; please consider contributing!" class="new" href="/en-US/docs/Web/JavaScript/Reference/Ops#Less">
&amp;gt;
</a></p>

I think the first version, that just used <%- str %>, might actually be right for both cases.

@jwhitlock
Copy link
Contributor

Manually merged the first commit to master.

@jwhitlock jwhitlock closed this Feb 9, 2017
@a2sheppy a2sheppy deleted the Bug1335006-fix-jsxref branch February 24, 2017 16:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants