Well, it's really just a different way of thinking about things. Instead of: ``` >>> import mwparserfromhell >>> text = "I has a template! {{foo|bar|baz|eggs=spam}} See it?" >>> wikicode = mwparserfromhell.parse(text) >>> templates = wikicode.filter_templates() ``` you would write: ``` js> Parsoid = require('parsoid'); js> text = "I has a template! {{foo|bar|baz|eggs=spam}} See it?"; js> Parsoid.parse(text, { document: true }).then(function(res) { templates = res.out.querySelectorAll('[typeof~="mw:Transclusion"]'); console.log(templates); }).done(); ```
That said, it wouldn't be hard to clone the API of http://mwparserfromhell.readthedocs.org/en/latest/api/mwparserfromhell.html and that would probably be a great addition to the parsoid package API. HTML is just a tree structured data representation. Think of it as XML if it makes you happier. It just happens to come with well-defined semantics and lots of manipulation libraries. I don't know about edits tagged as "VisualEditor". That seems like that should only be done by VE. I take it you would like an easy work flow to fetch a page, make edits, and then write the new revision back? mwparserfromhell doesn't actually seem to have that functionality, but it would also be nice to facilitate that use case if we can. --scott _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l