fix(Readability): treat S and BDI as phrasing content#1011
Conversation
e3eb4f3 to
888a768
Compare
gijsk
left a comment
There was a problem hiding this comment.
Thanks for the patch.
The testcase is a bit strange. We would typically add a minimal testcase to the testcases folder instead, with source and expected output.
I also think that we should include u and update the testcases accordingly (generate-testcase.js can do this for you if you delete the expected.html file first and then run it with the testcase slug as an argument). Or at least - I would like to see what changes that causes, before deciding whether any of these changes make sense. In isolation it is hard to see what this is really accomplishing.
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
|
Good points, thanks. Dropped the ad-hoc unit test and added a proper testcase under test-pages/phrasing-elements-s-bdi-u (source + expected regenerated with generate-testcase.js). I also added U to PHRASING_ELEMS as you suggested. The fixture makes the effect visible: without these tags in the list, the run gets shattered into separate blocks with the
|
PHRASING_ELEMSis missing the HTML5 phrasing elementsSandBDI, so Readability treats them as block-level and splits paragraphs around them (e.g.<div>foo <s>bar</s> baz</div>becomes<p>foo </p><s>bar</s><p> baz</p>). This adds both toPHRASING_ELEMSwith a regression test.Towards #997. I left
Uout for now because adding it changes the extracted output of the hukumusume test page, so that one is better handled separately.