UTF-8 BOM makes the title and header attributes unrecognized

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UTF-8 BOM makes the title and header attributes unrecognized

programandala.net
While rendering a big adoc file, every level 0 title caused an error:

        asciidoctor: ERROR: filename.adoc: line X: only book doctypes can
        contain level 0 sections

But ":doctype: book" was in the document header! The only way to make
the doctype effective was as command line parameter: "-a doctype=book".

After a little investigation with several test files and an hex viewer I
finally discovered the problem: the trouble document had an UTF-8 BOM
(Byte Order Mark) at the start: 0xEF, 0xBB and 0xBF. Then I used Vim to
remove the BOM and the errors disappeared.

When the BOM is present, the document is rendered but its title is
mistaken for ordinary content, and its header attributes too.

I guess this issue is an undocumented limitation.

--
Marcos Cruz
http://programandala.net
Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 BOM makes the title and header attributes unrecognized

mojavelinux
Administrator

Marcos,

This problem should be solved in 1.5.0.preview1 or, if not there, the latest master. Perhaps you can test against the latest source or as soon as I push up preview2. It was not solved in 0.1.4.

-Dan

On Feb 1, 2014 10:37 AM, "programandala.net [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
While rendering a big adoc file, every level 0 title caused an error:

        asciidoctor: ERROR: filename.adoc: line X: only book doctypes can
        contain level 0 sections

But ":doctype: book" was in the document header! The only way to make
the doctype effective was as command line parameter: "-a doctype=book".

After a little investigation with several test files and an hex viewer I
finally discovered the problem: the trouble document had an UTF-8 BOM
(Byte Order Mark) at the start: 0xEF, 0xBB and 0xBF. Then I used Vim to
remove the BOM and the errors disappeared.

When the BOM is present, the document is rendered but its title is
mistaken for ordinary content, and its header attributes too.

I guess this issue is an undocumented limitation.

--
Marcos Cruz
http://programandala.net



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/UTF-8-BOM-makes-the-title-and-header-attributes-unrecognized-tp1341.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML