https://bugzilla.wikimedia.org/show_bug.cgi?id=12998
[EMAIL PROTECTED] changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #5431 is|0 |1
obsolete| |
--- Comment #9 from [EMAIL PROTECTED] 2008-12-05 07:22:31 UTC ---
Created an attachment (id=5562)
--> (https://bugzilla.wikimedia.org/attachment.cgi?id=5562)
Proposed patch v2
Revised patch to use Sanitizer::stripAllTags, which works great! Now, my goal
in coding this patch was to completely eliminate the need for JavaScript hacks
to set the values of the <title> and <h1> elements. The <h1> element _must_ be
copy-pasteable (in other words, when you copy the <h1> text you should be able
to make a link to the article just by pasting what you have). However, we
permit non-normalizing titles in the <title> element because the user can't
easily select the contents of <title> to copy it.
We have some pretty weird titles on the English Wikipedia. It wouldn't be
unreasonable to have an article about something that had both a special
character and a superscript, say "Abc#d<sup>e</sup>f". In order to be as
accurate as possible, the DISPLAYTITLE magic word needs to be able to put
"Abc#def" in <title> and "Abcd<sup>e</sup>f" in <h1>. So, I've updated the
DISPLAYTITLE word to take two parameters. The syntax is now
{{DISPLAYTITLE:requestedDisplayTitleH1|requestedDisplayTitleTitle}}. If
requestedDisplayTitleTitle is not specified then a stripped version of
requestedDisplayTitleH1 is used in <title> instead.
I ran into problems trying to make an automated test suite for this, however I
did test it. Here are the major tests that I did manually on Main Page:
{{DISPLAYTITLE:<span style="text-decoration:underline">Main Page</span>}}
<title>Main Page - {{SITENAME}}</title>
<h1><span style="text-decoration:underline">Main Page</span> -
{{SITENAME}}</h1>
{{DISPLAYTITLE:<i>Main Page}}
<title>Main Page - {{SITENAME}}</title>
<h1><i>Main Page</i> - {{SITENAME}}</h1>
{{DISPLAYTITLE:Main#Page}}
<title>Main#Page - {{SITENAME}}</title>, <h1>Main Page - {{SITENAME}}</h1>
{{DISPLAYTITLE:<script>Main Page</script>}}
<title><script>Main Page</script> - {{SITENAME}}</title>
<h1>Main Page - {{SITENAME}}</h1>
{{DISPLAYTITLE:Main_P<sup>age</sup>|#Main_Page}}
<title>#Main_Page - {{SITENAME}}</title>
<h1>Main_P<sup>age</sup></h1>
{{DISPLAYTITLE:Main_P<sup>age</sup>|#<script>Main_Page</script>}}
<title>#<script>Main_Page</script> - {{SITENAME}}</title>
<h1>Main_P<sup>age</sup></h1>
So, what do you think? What else needs to be done before this can go into
MediaWiki?
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l