Giter Site home page Giter Site logo

naqvis / crystal-html5 Goto Github PK

View Code? Open in Web Editor NEW
34.0 4.0 3.0 174 KB

Crystal implementation of HTML5-Compliant Tokenizer and Parser with XPath & CSS Selector support

License: MIT License

Crystal 100.00%
crystal-language crystal-lang crystal-shard html5 html-parser html-tokenizer xpath2 crystal css-selectors

crystal-html5's People

Contributors

mrsorcus avatar naqvis avatar straight-shoota avatar watzon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crystal-html5's Issues

Removing attributes from nodes

Would it make sense to add a method like HTML5::Node#remove_attr? Right now the only way to do it is to do

node.attr.reject! { |attr| attr.key == key_to_delete }

I'm sure you can come up with some use for it, but the way that I'm using this currently is when an option of a select is picked, the other options need to have selected removed.

Syntax error in specs

"DOS\r\nDOS\r\nDOS\r\n": "DOS\nDOS\nDOS\n",

I accidentally ran crystal tool format without specifying which directories, and it ran on my lib/ dir ๐Ÿ˜‚ It then threw this error

syntax error in '././lib/html5/spec/token_spec.cr:546:7': can't use 'key: value' syntax in a hash literal

So I just wanted to pass that along ๐Ÿ˜„

CSS selector implementation

Hello,
Thanks for making this shard. It would be great if you could make the css selector just like javascript.
All the best.

Error: can't find file 'html5'

Hi, I'm getting the error below when trying to use this shard.

 2 | require "html5"
     ^
Error: can't find file 'html5'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?

If i use require "html", since the main file is html.cr, I get:

 12 | HTML5.parse(str)
      ^
Error: undefined constant HTML5

Did you mean 'HTML'?

If I use HTML.parse, I get:

 12 | HTML.parse(str)
             ^----
Error: undefined method 'parse' for HTML:Module

Maybe I'm doing something wrong. I don't have any experience with crystal.
The only way for this to work is to rename html.cr to html5.cr.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.