cooklang / cooklang-rs Goto Github PK
View Code? Open in Web Editor NEWCanonical Cooklang parser in Rust
Home Page: https://cooklang.github.io/cooklang-rs/
License: MIT License
Canonical Cooklang parser in Rust
Home Page: https://cooklang.github.io/cooklang-rs/
License: MIT License
multi-lines seems to be a feature of this parser
however, if an ingredient spans multiple lines, it fails to parse.
consider:
this:
Squeeze all the water from the defroshed @packed fresh spinach{5%cups}. Pulse
the spinach in a #food processor{} to roughly chop.
yields:
(good)
but this
Squeeze all the water from the defroshed @packed fresh
spinach{5%cups}. Pulse
the spinach in a #food
processor{} to roughly chop.
yields:
( bad :( )
note that when referencing an existing ingredient, this becomes a parse error.
ideally, line breaks would be valid anywhere, or at least between words.
Using common special chars in names, like space, ,
, .
, -
, _
, #
, `
and '
, can lead to unintended behavior.
For example:
Iain M. Banks <https://some.url>
-> no name and url Iain M. Banks <https://some.url>
Expected:
Iain M. Banks <https://some.url>
-> name Iain M. Banks
and url https://some.url
The PR #10 is improving the current behavior by adding more common special chars, that lead to the expected output and being more backward combatile. But a more general approach could be the final solution as mentioned here and here.
Hello,
when a colon is in the name part, it will led to unexpected results:
It looks like, that current validation of an URL is not considering this case:
if let Ok(url) = Url::parse(s) {
If this validation will be improved, the :
can be added to the regex for name and url (see) .
Have fun,
someone.earth
If there is no given name but an encapsulated URL, the url will be intepreted as name:
<https://rachel.url>
-> name <https://rachel.url>
and no URL
The expected behavior would be (at least for me):
<https://rachel.url>
-> no name and url https://rachel.url
This issues could be fixed, with a approach, that is also addressing this issue.
I played a bit around with the special metadata extension (in the playground, 0.12.0) and I noticed two non-working cases that I expected to work.
Cases that didn't work:
>> tags: Tag
>> tags: tag bla
I'm not sure if the behavior is intended but if so I think it should be documented because it is not obvious.
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.