Template:R/superscript: Difference between revisions

(expand tooltip-sensitive area to include the : or () prefix and suffix for as long as quote isn't used. This makes it easier to trigger the tooltip when the actual superscript contents (sup-where) contains a link. However, it doesn't look nice with a dashed underline (which occurs when the tooltip contains a quote as well), therefore continue the old style when quote is defined as well)
m (1 revision imported: Templates and CSS files)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- Only for internal use: |wrap=n[o]/y[es]/f[orced] |leadin=value |prefix=value |pp=value |where=value |sup-where=value |quote-where=value |quote=value |language=value |translation=value |suffix=value -->{{#if:{{{where|}}}|<sup class="reference {{#switch:{{{wrap|}}}|f|forced=|no}}wrap">{{#if:{{{quote|}}}|{{{prefix|}}}}}<span title="<!--{{#invoke:String|replace|source={{#invoke:String|replace|source={{#invoke:String|replace|source=-->{{#invoke:DecodeEncode|encode|s={{#invoke:Plain text|main|1={{{leadin|}}}: {{#if:{{{quote-where|}}}|{{{quote-where|}}}|{{{where|}}}}}|encode=false}}|charset=<>"}}<!--|"|&quot;}}|<|&lt;}}|>|&gt;}}-->{{#if:{{{quote|}}}|&#10;Quotation<!--{{#invoke:String|replace|source={{#invoke:String|replace|source={{#invoke:String|replace|source=-->{{#invoke:DecodeEncode|encode|s={{#invoke:Plain text|main|1={{#if:{{{language|}}}|&#32;({{{language|}}})}}: &quot;{{trim quotes|s={{{quote|}}}}}&quot;{{#if:{{{translation|}}}|&#10;Translation: &quot;{{trim quotes|s={{{translation}}}}}&quot;}}|encode=false}}|charset=<>"}}<!--|"|&quot;}}|<|&lt;}}|>|&gt;}}-->" class="tooltip tooltip-dashed" style="border-bottom: 1px dashed;}}">{{#if:{{{quote|}}}||{{{prefix|}}}}}<!--DEBUG: Take care of :;*# as first character here. This also breaks plainlinks/stripmarkers/catlinks testcases {{#invoke:String|replace|source=-->{{{pp|}}}{{{sup-where|}}}<!--| |&thinsp;}}-->{{#if:{{{quote|}}}||{{{suffix|}}}}}</span>{{#if:{{{quote|}}}|{{{suffix|}}}}}</sup>}}<noinclude>
<!-- Only for internal use: |wrap=n[o]/y[es]/f[orced] |leadin=value |prefix=value |pp=value |where=value |sup-where=value |quote-where=value |quote=value |language=value |translation=value |suffix=value -->{{#if:{{{where|}}}|<sup class="reference {{#switch:{{{wrap|}}}|f|forced=|no}}wrap">{{#if:{{{quote|}}}|{{{prefix|}}}}}<span title="<!--{{#invoke:String|replace|source={{#invoke:String|replace|source={{#invoke:String|replace|source=-->{{#invoke:DecodeEncode|encode|s={{#invoke:Plain text|main|1={{{leadin|}}}: {{#if:{{{quote-where|}}}|{{{quote-where|}}}|{{{where|}}}}}|encode=false}}|charset=<>"}}<!--|"|&quot;}}|<|&lt;}}|>|&gt;}}-->{{#if:{{{quote|}}}|&#10;Quotation<!--{{#invoke:String|replace|source={{#invoke:String|replace|source={{#invoke:String|replace|source=-->{{#invoke:DecodeEncode|encode|s={{#invoke:Plain text|main|1={{#if:{{{language|}}}|&#32;({{#ifeq:{{lang|fn=is_ietf_tag|{{{language|}}}}}|true|{{lang|fn=name_from_tag|{{{language|}}}}}|{{{language|}}}}})}}: &quot;{{trim quotes|s={{{quote|}}}}}&quot;{{#if:{{{translation|}}}|&#10;Translation: &quot;{{trim quotes|s={{{translation}}}}}&quot;}}|encode=false}}|charset=<>"}}<!--|"|&quot;}}|<|&lt;}}|>|&gt;}}-->" class="tooltip tooltip-dashed" style="border-bottom: 1px dashed;}}">{{#if:{{{quote|}}}||{{{prefix|}}}}}<!--DEBUG: Take care of :;*# as first character here. This also breaks plainlinks/stripmarkers/catlinks testcases {{#invoke:String|replace|source=-->{{{pp|}}}{{{sup-where|}}}<!--| |&thinsp;}}-->{{#if:{{{quote|}}}||{{{suffix|}}}}}</span>{{#if:{{{quote|}}}|{{{suffix|}}}}}</sup>}}<noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Latest revision as of 19:25, 4 December 2022