shrface icon indicating copy to clipboard operation
shrface copied to clipboard

Trying to use shrface-outline-cycle(-buffer) getting error `Before first heading` always

Open Seme4eg opened this issue 1 year ago • 1 comments

Opened the https://github.com/chenyanming/shrface in eww, trying to cycle and it throws me that error.

My current setup: https://0x0.st/X4oy.bin

Seme4eg avatar Aug 14 '24 09:08 Seme4eg

The problem is in the HTML. <h2 class="sr-only">Navigation Menu</h2>. There is no preceding h1 to get a level-1 org heading.

Avenues of investigation.

  • advice markdown-back-to-heading-over-code-block in markdown-mode.el (or wherever the appropriate place is) to use a different more flexible regexp to locate headings
  • perform replacement in HTML before rendering such that a h1 always exists. So <h2 class becomes <h1 class, <h3 class becomes <h2 class and so on. I tried this on an epub and while it renders correctly folding doesn't work as intended.

Edit: Upon further testing I'm not so sure my conclusions are actually correct. The epub I thought was broken now folds properly, opened in both nov and eww.

stvlm6 avatar Jan 15 '25 05:01 stvlm6