Code Monkey home page Code Monkey logo

Comments (2)

akabekobeko avatar akabekobeko commented on June 21, 2024

Reports from @MurakamiShinyu

わかりました。

<nav id="toc">
<h2>Contents</h2>
	<ol>
		<li><a href="#1">A Scandal in Bohemia</a>
...
<h2><a id="1"><span class="chap-num">Adventure I</span> A Scandal in Bohemia</a></h2>
...

id が数字ではじまっています。HTML5からこれはOKになったはずなのですが、pagedjs内部でidと認識しないでバグっているようです。数字の前に "id" をつけて href="#id1" id="id1" などとしたら、動きました。vivliostyle_doc のほうを修正しますね。(コロン→セミコロンの修正も)

from examples-vivliostyle-pagedjs.

akabekobeko avatar akabekobeko commented on June 21, 2024

Reports from @MurakamiShinyu

id についてHTML仕様に https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute

... IDs can consist of just digits, start with a digit, ...

と明記されています。
サンプルは直さない方がよいですね。pagedjsのバグとしてpagedjsに報告するのが適切だと思います。

pagedjs内部でidと認識しないでバグっているようです。

と書いたのも訂正したい。idと認識されてます。pagedjsは各idに対してCSSのセレクタを作るようです。id="1" に対してそのセレクタが #1 になってるのが問題です。CSSでは数字ではじまるのはダメなのでエスケープが必要で #\31 などとしなくてはいけません。それで querySelector()で invalid selector のエラーが起きています。

Issueとしては、数字で始まるidがHTML内にあるとpagedjsがハングアップするとだけ伝えれば十分でしょう。

from examples-vivliostyle-pagedjs.

Related Issues (16)

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.