https://bugzilla.wikimedia.org/show_bug.cgi?id=62805

            Bug ID: 62805
           Summary: Serialization of modified images sometimes outputs
                    NaNxNaNpx
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: serializer
          Assignee: gwi...@wikimedia.org
          Reporter: roan.katt...@gmail.com
                CC: csc...@laptop.org, jforres...@wikimedia.org,
                    ssas...@wikimedia.org
       Web browser: ---
   Mobile Platform: ---

* Parse a page with a right-floating frameless image from
  wikitext to HTML
* Result HTML has class="mw-default-size mw-halign-right";
  change this to class="mw-halign-right"
* Serialize modified HTML back to wikitext
* A wild NaN appeared!


$ echo "[[File:Hol_komm.png|right|frameless]]" | node tests/parse.js

<body data-parsoid='{"dsr":[0,38,0,0]}'><figure class="mw-default-size
mw-halign-right" typeof="mw:Image/Frameless"
data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"frameless","ak":"frameless"}],"dsr":[0,37,2,2]}'><a
href="./File:Hol_komm.png"
data-parsoid='{"a":{"href":"./File:Hol_komm.png"},"dsr":[2,35,null,null]}'><img
resource="./File:Hol_komm.png"
src="//upload.wikimedia.org/wikipedia/commons/f/f1/Hol_komm.png" height="151"
width="125"
data-parsoid='{"a":{"resource":"./File:Hol_komm.png","height":"151","width":"125"},"sa":{"resource":"File:Hol_komm.png"}}'/></a></figure>
</body>

$ echo "[[File:Hol_komm.png|right|frameless]]" | node tests/parse.js | tee
frameless.html

<body data-parsoid='{"dsr":[0,38,0,0]}'><figure class="mw-default-size
mw-halign-right" typeof="mw:Image/Frameless"
data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"frameless","ak":"frameless"}],"dsr":[0,37,2,2]}'><a
href="./File:Hol_komm.png"
data-parsoid='{"a":{"href":"./File:Hol_komm.png"},"dsr":[2,35,null,null]}'><img
resource="./File:Hol_komm.png"
src="//upload.wikimedia.org/wikipedia/commons/f/f1/Hol_komm.png" height="151"
width="125"
data-parsoid='{"a":{"resource":"./File:Hol_komm.png","height":"151","width":"125"},"sa":{"resource":"File:Hol_komm.png"}}'/></a></figure>
</body>

$ sed -i frameless.html -e 's/mw-default-size //'
$ cat frameless.html

<body data-parsoid='{"dsr":[0,38,0,0]}'><figure class="mw-halign-right"
typeof="mw:Image/Frameless"
data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"frameless","ak":"frameless"}],"dsr":[0,37,2,2]}'><a
href="./File:Hol_komm.png"
data-parsoid='{"a":{"href":"./File:Hol_komm.png"},"dsr":[2,35,null,null]}'><img
resource="./File:Hol_komm.png"
src="//upload.wikimedia.org/wikipedia/commons/f/f1/Hol_komm.png" height="151"
width="125"
data-parsoid='{"a":{"resource":"./File:Hol_komm.png","height":"151","width":"125"},"sa":{"resource":"File:Hol_komm.png"}}'/></a></figure>
</body>

$ cat frameless.html | node tests/parse.js --html2wt

[[File:Hol_komm.png|right|frameless|NaNxNaNpx]]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to