Giter VIP home page Giter VIP logo

hast-util-from-parse5's People

Contributors

christianmurphy avatar greenkeeperio-bot avatar nokome avatar remcohaszing avatar wooorm avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hast-util-from-parse5's Issues

Space-separated attribute values are not treated as lists

First of all, thank you for creating and open sourcing HAST and Unist. They are very well structured and easy to use.

I noticed a disagreement between the spec and the parser, though. I have the following HTML:

<div block="b1 b2"></div>

The parser returns the following HAST:

        {
          "type": "element",
          "tagName": "div",
          "properties": {
            "block": "b1 b2"
          },
          "children": []
        }

I expected it to be:

        {
          "type": "element",
          "tagName": "div",
          "properties": {
            "block": ["b1", "b2"]
          },
          "children": []
        }

Does it work as expected and I should just split the value myself or is it an issue of the parser which should be corrected?

RangeError when trying to parse a big html file

Hi, I tried to parse this file (~887KB) but it will end up in a Maximum call stack size exceeded error.

  1:1  error  RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)
    at normalize (E:\Repositorys\prettyhtml\packages\prettyhtml-hastscript\node_modules\property-information\normalize.js:6:30)
    at find (E:\Repositorys\prettyhtml\packages\prettyhtml-hastscript\node_modules\property-information\find.js:16:16)
    at addProperty (E:\Repositorys\prettyhtml\packages\prettyhtml-hastscript\factory.js:50:12)
    at h (E:\Repositorys\prettyhtml\packages\prettyhtml-hastscript\factory.js:25:9)
    at element (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\index.js:167:10)
    at transform (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\index.js:70:10)
    at nodes (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\index.js:99:21)
    at transform (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\index.js:67:16)
    at nodes (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\index.js:99:21)

the reasons are obvious because there are too many "attributes" which results in too many "normalization" calls. Is there any chance to fix that?

Hot to increase the diff depth in tests?

Hi, I forked this repository and need to update some tests but the error message is very cryptic because we have to compare deep objects. How do you deal with that? It's very hard to debug. Do you know a better tape-reporter? (I tried several without success)

not ok 47 p5 w/o position, hast w/o intent of position
  ---
    operator: deepEqual
    expected: |-
      { type: 'root', children: [ { type: 'doctype', name: 'html', public: null, system: null }, { type: 'element', tagName: 'html', properties: {}, children: [ { type: 'element', tagName: 'head', properties: [Object], children: [Object] }, { type: 'element', tagName: 'body', properties: [Object], children: [Object] } ] } ], data: { quirksMode: false } }
    actual: |-
      { type: 'root', children: [ { type: 'doctype', name: 'html', public: null, system: null }, { type: 'element', tagName: 'html', properties: {}, children: [ { type: 'element', tagName: 'head', properties: [Object], children: [Object] }, { type: 'element', tagName: 'body', properties: [Object], children: [Object] } ] } ], data: { quirksMode: false } }
    at: checkNoNo (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\test\index.js:425:7)
    stack: |-
      Error: p5 w/o position, hast w/o intent of position
          at Test.assert [as _assert] (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:224:54)
          at Test.bound [as _assert] (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:76:32)
          at Test.tapeDeepEqual (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:421:10)
          at Test.bound [as deepEqual] (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:76:32)
          at checkNoNo (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\test\index.js:425:7)
          at Test.<anonymous> (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\test\index.js:370:7)
          at Test.bound [as _cb] (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:76:32)
          at Test.run (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:95:10)
          at Test.bound [as run] (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:76:32)
          at Test._end (E:\Repositorys\prettyhtml\packages\prettyhtml-hast-util-from-parse\node_modules\tape\lib\test.js:164:11)

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.