Code Monkey home page Code Monkey logo

html5outliner's People

Contributors

hoyois 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  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  avatar  avatar  avatar

html5outliner's Issues

Depth Does Not Increase With Section Nesting

When I try to get the depth of heading elements, they always return a value of 1, as opposed to their section depth (body > article > h1 should be depth 2), regardless of where they are located in the document.

Feature Request: HTML Output

The similar h5o project has an outline object method called asHTML() that outputs an ordered list of section titles, optionally as hyperlinks (using the section’s id or generating one if there’s none), that can be used to output a table of contents. I’d like to see that in this one. Right now I am using both scripts for their unique features, which means I incur a performance hit making the client download two separate scripts that do essentially the same thing, and then running them both.

found an inconsistent result from https://gsnedders.html5.org/outliner/

I've tested following code both using your tools and tools from https://gsnedders.html5.org/outliner/ , and found that they return different results

<body>
    <section>
        <section>
            <h1>Wind</h1>
            <p>xxx
        </section>
        <p>yyy
        <section>
            <h1>Cloud</h3>
            <p>zzz
        </section>
        <h1>Rain</h1>
    </section>
</body>

result from your tools:

1.Document
    1.Section
        1.Wind
        2.Cloud
    2.Rain

result from https://gsnedders.html5.org/outliner/

1.Untitled Section
    1.Rain
        1.Wind
        2.Cloud

I don't know which one is more correct...

First heading after subsection

If I’m not mistaken, I might have found a bug.

Take this document:

<body>
    <section>
      <nav></nav>
      <h1>Only heading</h1>
    </section>
</body>

The HTML5 Outliner produces this outline:

html5-outliner_ex1

But I think this should be the correct outline:

html5-outliner_ex2

The current HTML5 CR says:

The first element of heading content in an element of sectioning content represents the heading for that section.

So shouldn’t it use the h1 as heading for the section even though this h1 comes after the nav?


I’m not sure what the correct behaviour is when this happens in the body sectioning root, e.g.:

<body>
  <nav></nav>
  <h1>Only Heading</h1>
</body>

The quoted spec explicitly mentions "in an element of sectioning content", so it doesn’t necessarily apply to sectioning root elements.

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.