Merge pull request #5932 from AlfredoRamos/ticket/15572

[ticket/15572] Fix W3C validation error for quote BBCode
This commit is contained in:
Marc Alexander 2020-04-21 21:16:49 +02:00
commit 1dc5c4f98f
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
4 changed files with 11 additions and 5 deletions

View file

@ -13,6 +13,9 @@
<!-- BEGIN quote_close --></div></blockquote><!-- END quote_close --> <!-- BEGIN quote_close --></div></blockquote><!-- END quote_close -->
<!-- BEGIN quote_extended --> <!-- BEGIN quote_extended -->
<blockquote> <blockquote>
<xsl:if test="@post_url">
<xsl:attribute name="cite"><xsl:value-of select="@post_url"/></xsl:attribute>
</xsl:if>
<xsl:if test="not(@author)"> <xsl:if test="not(@author)">
<xsl:attribute name="class">uncited</xsl:attribute> <xsl:attribute name="class">uncited</xsl:attribute>
</xsl:if> </xsl:if>
@ -42,7 +45,7 @@
<a href="{@msg_url}" data-msg-id="{@msg_id}">&#8593;</a> <a href="{@msg_url}" data-msg-id="{@msg_id}">&#8593;</a>
</xsl:if> </xsl:if>
<xsl:if test="@date"> <xsl:if test="@date">
<div class="responsive-hide"><xsl:value-of select="@date"/></div> <span class="responsive-hide"><xsl:value-of select="@date"/></span>
</xsl:if> </xsl:if>
</cite> </cite>
</xsl:if> </xsl:if>

View file

@ -484,7 +484,7 @@ blockquote cite:before, .uncited:before {
padding-right: 5px; padding-right: 5px;
} }
blockquote cite > div { blockquote cite > span {
float: right; float: right;
font-weight: normal; font-weight: normal;
} }

View file

@ -279,7 +279,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
), ),
array( array(
'[quote=Username post_id=123]...[/quote]', '[quote=Username post_id=123]...[/quote]',
'<blockquote><div><cite>Username wrote: <a href="phpBB/viewtopic.php?p=123#p123" data-post-id="123" onclick="if(document.getElementById(hash.substr(1)))href=hash">↑</a></cite>...</div></blockquote>' '<blockquote cite="phpBB/viewtopic.php?p=123#p123"><div><cite>Username wrote: <a href="phpBB/viewtopic.php?p=123#p123" data-post-id="123" onclick="if(document.getElementById(hash.substr(1)))href=hash">↑</a></cite>...</div></blockquote>'
), ),
array( array(
// Users are not allowed to submit their own URL for the post // Users are not allowed to submit their own URL for the post
@ -288,7 +288,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
), ),
array( array(
'[quote=Username time=58705871]...[/quote]', '[quote=Username time=58705871]...[/quote]',
'<blockquote><div><cite>Username wrote:<div class="responsive-hide">1971-11-11 11:11:11</div></cite>...</div></blockquote>' '<blockquote><div><cite>Username wrote:<span class="responsive-hide">1971-11-11 11:11:11</span></cite>...</div></blockquote>'
), ),
array( array(
'[quote=Username user_id=123]...[/quote]', '[quote=Username user_id=123]...[/quote]',

View file

@ -13,6 +13,9 @@
{% for quote_close in loops.quote_close %}</div></blockquote>{% endfor %} {% for quote_close in loops.quote_close %}</div></blockquote>{% endfor %}
{% for quote_extended in loops.quote_extended %} {% for quote_extended in loops.quote_extended %}
<blockquote> <blockquote>
<xsl:if test="@post_url">
<xsl:attribute name="cite"><xsl:value-of select="@post_url"/></xsl:attribute>
</xsl:if>
<xsl:if test="not(@author)"> <xsl:if test="not(@author)">
<xsl:attribute name="class">uncited</xsl:attribute> <xsl:attribute name="class">uncited</xsl:attribute>
</xsl:if> </xsl:if>
@ -38,7 +41,7 @@
<a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a> <a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a>
</xsl:if> </xsl:if>
<xsl:if test="@date"> <xsl:if test="@date">
<div class="responsive-hide"><xsl:value-of select="@date"/></div> <span class="responsive-hide"><xsl:value-of select="@date"/></span>
</xsl:if> </xsl:if>
</cite> </cite>
</xsl:if> </xsl:if>