Closed Bug 782250 Opened 12 years ago Closed 4 years ago

Single quotes in template calls converted to double quotes after save, breaking page

Categories

(developer.mozilla.org Graveyard :: Editing, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jwkbugzilla, Unassigned)

References

Details

I tried invoking a template like this: {{ note("foo <a href='#bar'>bar</a>.") }} Note that the tag uses single quotation marks which avoids syntax errors. This works fine if I click "preview changes". However, if I save the page like this I get a syntax error: apparently, there is HTML Tidy or something like this running when the page is saved but not for preview. This step will unify quotation marks and change to double quotation marks for the tag - which breaks the template invocation.
Hey Wladimir. Just noticed your email address. Thanks for all of your hard work, and for using the MDN. I will be sure we look into this.
Summary: Kuma: Preview is not identical to the resulting page → Single quotes in template calls converted to double quotes after save, breaking page
Priority: -- → P1
Version: Kuma → unspecified
Component: Docs Platform → Editing
Here's an example working around this issue: https://developer.mozilla.org/en-US/docs/User:lmorchard/TestQuoting Some further notes: * There also exist {{ NoteStart }} and {{ NoteEnd }} macros which help with more complex content in notes that need markup. This was not possible in dekiscript, but we should be able to split more template-driven markup conventions this way * You can also use single quotes in macros, like so: {{ note('foo <a href="#bar">bar</a>.') }} * You can also also escape double quotes (or single quotes): {{ note("foo <a href=\"#bar\">bar</a>.") }} I'm not sure how that last one interacts with HTML processing in Kuma, though. Which means this may still be a bug worth addressing. (ie. don't mess with HTML inside templates when doing markup processing on content submssion)
Yeah, we need to use the start/end template form more for this, I think, as it's much less insane. :)
I think need document. And I think this is better: <div>{{ note('foo <a href="cake.html">tom&apos;s cake</a>' ) }}</div> Maybe Some people will feel this is difficult, but it can't be helped.
Priority: P1 → --
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.