You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be nice to have a list of elements which "break line" when textified. I actually this in my HTML::AsText::Fix:
# source: http://en.wikipedia.org/wiki/HTML_element#Block_elements
%isBlockElement = map {; $_ => 1 } qw(
p
h1 h2 h3 h4 h5 h6
dl dt dd
ol ul li
dir
address
blockquote
center
del
div
hr
ins
noscript script
pre
);
Not sure what to do with <br>: it breaks line but it's not a block element.
The text was updated successfully, but these errors were encountered:
I think it would be useful to list all tags which affect the screen display AND are NOT flow/inline/phrasal. That is, one of their characteristics would be that they cause line breaks in most (if not all) cases. %isBlockElement is fine as a name, although for consistency with %isPhraseMarkup, perhaps it should be %isBlockMarkup?
There is still the question as to whether tags which put nothing directly on the screen (e.g., ) but might have children which do, should go into the %isBlockElement or %isPhraseMarkup, or get a new list: %isNonDisplayMarkup? Also, should %isBlockElement contain children which can only appear under another block element (e.g., thead, tbody, tfoot, tr, caption, etc. under table; or leave it as just table)? It's not clear how these lists are intended to be used. Presumably a given tag should appear only once in a "basic" list, and possibly again in composite lists.
Changes needed for %isBlockElement:
remove 'ins' and 'del'. They belong in %isPhraseMarkup.
add 'menu', 'map', 'area', 'marquee', 'noscript', 'script', 'frameset', 'frame', 'noframes', 'form', 'table', 'search', 'multicol', 'layer', 'nolayer', 'bgsound', 'applet'. Some of these don't create output, so it's questionable where they should go. It's probably safer in %isBlockElement than in %isPhraseMarkup (less chance of disrupting the flow). Some have children which produce output to the page, while others don't.
That should bring it up to date for HTML v4 (see also Github #5)
Migrated from RT originally by
[email protected]
Would be nice to have a list of elements which "break line" when textified. I actually this in my HTML::AsText::Fix:
Not sure what to do with
<br>
: it breaks line but it's not a block element.The text was updated successfully, but these errors were encountered: