ashinn / alschemist Goto Github PK
View Code? Open in Web Editor NEWVarious Scheme Libraries
Various Scheme Libraries
This is admittedly something I noticed in CHICKEN Scheme, not Chibi, but I was told that the CHICKEN bindings for html-parser are just a thin wrapper around the same code for Chibi.
Anyways, there's some weirdness with escaping quotes in text when using html->sxml
. Perhaps a short example would be sufficient to explain the problem I'm encountering:
(html->sxml "<p>foo'bar"baz</p>") ;=> (*TOP* (p "foo" "'" "bar" "\"" "baz"))
As a counter-example, I'll use the ssax egg:
(call-with-input-string "<p>foo'bar"baz</p>" (cut ssax:xml->sxml <> '())) ;=> (*TOP* (p "foo'bar\"baz"))
I guess fundamentally it's a question of whether there should be one text node or not. I would argue that in this particular case, it should be a single node. I have been using html-parser to try and scrape some web pages, and this is extremely unexpected! Especially so if one uses txpath
/ sxpath
on the final result, as //p/text()
queries will not necessarily behave as expected. You would have to (apply string-append ((txpath "//p/text()") sxml))
to the result to get the full contents of the text.
Is there a rationale for this, or is that some kind of limitation of the parser? I know that tags may also contain sub-tags in HTML, but I'm not sure a new node should be made if a tag's contents are not HTML tags themselves.
See copy of this ticket on the CHICKEN bug tracker.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.