Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: TOCs and deeplinks for our house rules

by RonW (Parson)
on Nov 03, 2017 at 23:28 UTC ( #1202728=note: print w/replies, xml ) Need Help??


in reply to Re^2: TOCs and deeplinks for our house rules
in thread TOCs and deeplinks for our house rules

Some h3 needed to be h4 to be properly nested

Sounds like your TOC generator has gone beyond mine. That great!

FWIW, I didn't try dealing with header nesting because a lot of the HTML to be processed was very poorly written. If I had, the TOC would have looked haphazard.

  • Comment on Re^3: TOCs and deeplinks for our house rules

Replies are listed 'Best First'.
Re^4: TOCs and deeplinks for our house rules
by LanX (Archbishop) on Nov 03, 2017 at 23:46 UTC
    > FWIW, I didn't try dealing with header nesting because a lot of the HTML to be processed was very poorly written. If I had, the TOC would have looked haphazard.

    actually I don't know yet how to deal best with wrong nesting.

    E.g a h6 following a h4 would be ignored now (or added to the last h5 which is nonsense*)

    I don't know if it's better to

    • include the missing intermediate levels
    Or
    • ignore the heading
    A warning should be emitted anyway.

    Another nice to have would be to parse already available anchors, to allow multiple runs.

    Again the problem arises if a new anchor should be generated or the last one taken.

    I think all of this should be configurable, but so many options make this already a candidate for a proper module. ...

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    *) actually this explains weird problems I saw with latex beamer and wrong nesting. .. cool insight into alien code.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1202728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2019-12-11 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?