Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
339 stars 228 forks source link

<br/> not respected within certain HTML elements in conversion to Net #2754

Open pzinn opened 1 year ago

pzinn commented 1 year ago

html SPAN {"a", BR{}, "b"} produces (as should be) <span> a <br/> b </span>, which results in a & b on separate lines. however, net SPAN {"a", BR{}, "b"} results in ab (no line break). In general, it seems the conversion of HTML to Net ignores BR within tags which are not of the type HypertextContainer (as opposed to just Hypertext, not that these distinctions of type make much sense in the first place). This does not match the intended effect (e.g. in a browser) and should therefore be considered a bug. The relevant code is in format.m2 (I think -- it's rather hard to parse...).

pzinn commented 1 year ago

among the many related issues with the parser part of format.m2: in a browser, DIV { DIV "1", DIV "2" } and DIV { DIV "1", DIV PRE "2" } will look exactly the same up to font choice. However, once converted to Net, the first one is 1 and then 2 below, as should be, but the second one inserts an extra empty line in between. I have not found a way to prevent this extra line break yet -- DIV { DIV "1", SPAN PRE "2" } would work both in a browser and in Net form, but since M2 follows strict "valid content" guidelines, this will not validate (can't have a PRE inside a SPAN).