Re: GJS : How can I use Regex ( parse HTML ) ?



Keep regular expression in this particular task of yours, but try learning
every mentioned approach involving a proper html parser.

Npm way using cgjs, and e.g. htmlparser2 or parse5, for a standalone app, with the drawback of fragility. Same but using webpack, for a gnome shell extension, with the tradeoff of huge dependencies. And the GObject way with gxml, which should be easier and less prone to errors but you won't find the library in
many distributions so will have to build it locally.

Also subscribe to https://gitlab.gnome.org/GNOME/gjs/issues/216 where a
relevant discussion was held and still is open.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]