Closed (fixed)
Project:
Pullquote
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Mar 2011 at 16:06 UTC
Updated:
27 Mar 2013 at 04:20 UTC
Jump to comment: Most recent file
We should add a few checks in the JS that if a pullquote is used within HTML tags other than <p>, for example <li> <ol> <ul> <quote> <blockquote> etc that it both renders the pullquote correctly and in compliance with W3C standards.
For example:
* adding pullquote to a list adds an orphaned span tag sitting with the <ul> tag which doesn't meet W3C specification. The JS should be changed to add an IF statement to check if the parent is a <li> and if so, place the pullquote above the <ul> tag.
* if text within the <blockquote> tag, is marked up with pullquote, the rendered pullquote loses the shaded background.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | EmbeddedHTMLFix-1082348_3.patch | 2.62 KB | lliss |
| #1 | EmbeddedHTMLFix-1082348.patch | 1.71 KB | callison |
Comments
Comment #1
callison commentedWell, I'm a bit new to jQuery, so this may not be the most elegant solution, but it works.
I got to thinking about this and realized this not only affects list tags, but tables, blockquotes, and other things as well. So, what I did was a loop to continue moving the inserted content up until it's no longer inside any of the "bad" elements (which is included in an array and can easily be added to at any time should we think of something else). I'd love feedback on my implementation and if there's an easier/better way to do it. Thanks.
Comment #2
callison commentedComment #3
lliss commentedNice work. Thanks very much. I tested this out and it got me thinking even more about the desired functionality. I think it would be optimal to add the span above any of the "bad" elements listed in your array. I combined your work with this idea to have the span tag simply applied above the "bad" elements (ul, li, table, etc.) and inside the "good" (p, div, span, etc.). The one weird situation is blockquotes which only allow block level elements inside of them so in this case we'll add a div tag.
We don't need to worry about the span tag applied above ul or table tags because the entire main content area is wrapped in a div so a free standing span is no trouble.
I'm attaching my new idea as a patch (which I also applied to the dev branch).
Try pasting this HTML into your content area and observe the results. The generated HTML should be pass validation at validator.w3.org (or at least the generated HTML we're responsible for). I think this covers most reasonable cases. Let me know if you feel otherwise.
Comment #4
lliss commentedThis has been committed.