Jump to content

User:Enterprisey/parsoid-round-trip

From Wikipedia, the free encyclopedia
parsoid-round-trip
Author(s)Enterprisey
StatusStable
UpdatedOctober 29, 2020; 4 years ago (2020-10-29)
BrowsersFirefox
SkinsVector
SourceUser:Enterprisey/parsoid-round-trip.js

Uses Parsoid to convert some wikitext to HTML, and then to convert that HTML back to wikitext. Shows the result, and its difference from the original wikitext. Go to Special:BlankPage/Parsoid round trip once you've installed it.

Installation instructions

[edit]

Hint: It's much easier if you get ScriptInstaller, then navigate to User:Enterprisey/parsoid-round-trip.js and click "Install" at the top.

However, here's the manual method:

  1. Place {{subst:iusc|User:Enterprisey/parsoid-round-trip.js}} on Special:MyPage/common.js or a skin-specific page, like Special:MyPage/vector.js.
  2. Clear your cache and enjoy!

Usage

[edit]

Go to Special:BlankPage/Parsoid round trip, put some wikitext in the box, and click the button.

Roundtripping caveat

[edit]

In production (on the real website), edited HTML is converted to wikitext using an algorithm called selective serialization. Parsoid uses it to eliminate the vast majority of dirty diffs. However, the round-tripping from this script does not use the selective serialization mode (and if used, Parsoid would simply return the original wikitext, since there are no HTML edits). As such, you will likely see a lot of dirty diffs from this script, which is not representative of what happens in production usage.

See also

[edit]