php-textile
php-textile copied to clipboard
Don't apply blockquote attributes to paragraphs
I have a CSS class that puts a border on blockquotes. I've noticed that when I do a class in 3.5.4., the class gets put on the inner paragraph, thereby giving me a double border.
So..
bq(speech). Semper ubi sub ubi
Gives me:
<blockquote class="speech">
<p class="speech">Semper ubi sub ubi</p>
</blockquote>
Why is the class being added to the inner paragraph when it's just meant for the bq?
Is there a way to stop this or is this a bug? Thanks.
Its intentionally done in the code rather than being a bug. Textile will pass all attributes apart from cite and id to the paragraphs, since you will not have direct access to the paragraphs themselves. Altho, that is rather useless as you can't apply attributes to a single paragraph and you can as easily select the children by the parent.
Now, as you could select the children by the parent, you can also apply the border to the blockquote only. You can either overwrite:
.speech .speech {
border: none;
}
Or select only parent most:
article > .speech, div > .speech {
border: 1px solid #000;
}
Since attribute inheritance is pointless, and limiting as parsing goes, we'll going remove it, eventually. This is likely to happen in the next major/minor release (4.0.0 or 3.6.0), (but not sooner) as dropping this 'feature' alters generated structure semantically and thus breaks backwards compatibility.
You could also use this CSS rule to achieve the same thing:
blockquote.speech {
border: 1px solid #000;
}
Right. In the midst of moving servers and upgrading things. Sometimes the caffeine-deprived mind doesn't think things through! :-)
Opening this.