aantron / lambdasoup

Functional HTML scraping and rewriting with CSS in OCaml
https://aantron.github.io/lambdasoup
MIT License
384 stars 31 forks source link

Lost of namespaces #12

Closed zoggy closed 3 months ago

zoggy commented 7 years ago

Is there a reason for throwing away namespace prefixes ?

https://github.com/aantron/lambda-soup/blob/master/src/soup.ml#L122-L124

aantron commented 7 years ago

There is no really good reason at this point.

The original reason was that this library was (originally) written over Ocamlnet's Nethtml parser. As you can see, its API doesn't expose namespaces.

aantron commented 7 years ago

Is this something you would like to see added?

zoggy commented 7 years ago

Yes, as I got bitten when reading and writing xhtml containing svg: missing namespaces resulted in incorrect svg.

aantron commented 7 years ago

Fair enough. I will add them, in I guess some weeks. Thanks for reporting.

zoggy commented 7 years ago

Thanks, There is no emergency.

aantron commented 5 years ago

I hadn't known about this before: https://www.w3.org/TR/2014/REC-css-namespaces-3-20140320/

toastal commented 2 years ago

Any new word on this? I could use the support for SVG parsing right now.