How to delete first underscore in section ID?

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

How to delete first underscore in section ID?

DrAscii
Hi guys,

== This Is A Test

produces

<h2 id="_this_is_a_test">This Is A Test<h2>

How can I get rid of the first underscore in the section ID?

Thanks!

Best regards
DrAscii
Reply | Threaded
Open this post in threaded view
|

Re: How to delete first underscore in section ID?

David Jencks
See 16.2. Auto-generated IDs

In my experience, people who ignore the warning and set the idprefix to empty generally thereby  introduce several invalid ids into their document.

David Jencks

On Feb 29, 2020, at 10:02 AM, DrAscii [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Hi guys,

== This Is A Test

produces

<h2 id="_this_is_a_test">This Is A Test<h2>

How can I get rid of the first underscore in the section ID?

Thanks!

Best regards
DrAscii


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/How-to-delete-first-underscore-in-section-ID-tp7706.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: How to delete first underscore in section ID?

mojavelinux
Administrator
Agreed. It can be done, but it's a "use at your own risk" sort of thing. Generally, HTML doesn't care what characters are used in an ID, but other output formats do.

-Dan

On Sat, Feb 29, 2020 at 11:22 AM David Jencks [via Asciidoctor :: Discussion] <[hidden email]> wrote:
See 16.2. Auto-generated IDs

In my experience, people who ignore the warning and set the idprefix to empty generally thereby  introduce several invalid ids into their document.

David Jencks

On Feb 29, 2020, at 10:02 AM, DrAscii [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Hi guys,

== This Is A Test

produces

<h2 id="_this_is_a_test">This Is A Test<h2>

How can I get rid of the first underscore in the section ID?

Thanks!

Best regards
DrAscii


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/How-to-delete-first-underscore-in-section-ID-tp7706.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML




If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/How-to-delete-first-underscore-in-section-ID-tp7706p7707.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: How to delete first underscore in section ID?

DrAscii
In my case (HTML output only and non-English document language) setting the attribut
:idprefix:
 works very well. Thank you for your help!

Best regards
DrAscii