Include directive by line range with multiple ranges not working

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

Include directive by line range with multiple ranges not working

Jeremie Bresson
Hi,

I am trying to work with the Include directive by line ranges.

Given this file lines.txt:

[source,txt]
----
line one
line two
line three
line four
line five
line six
line seven
line eight
line nine
line ten
line eleven
line twelve
line thirteen
line fourteen
line fifteen
line sixteen
line seventeen
line eighteen
line nineteen
----

I have this test (document.adoc)

[source,asciidoc]
----
Test Multiple ranges:

[source]
----
include::lines.txt[lines=4..5,10..12]
----
----

I expect the input to contain:
line four
line five
line ten
line eleven
line twelve

I got only the first range:
line four
line five

My current workaround is to do:
[source]
----
include::lines.txt[lines=4..5]
include::lines.txt[lines=10..12]
----

But I think it is a bug. Can you confirm it?
And tell me where I should open an issue (documentation or implementation)?
Reply | Threaded
Open this post in threaded view
|

Re: Include directive by line range with multiple ranges not working

mojavelinux
Administrator
Jeremie,

On Wed, Apr 29, 2015 at 2:41 AM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
But I think it is a bug. Can you confirm it?

Due to the fact that a comma separates attributes, you have to quote the attribute value when using multiple ranges. The other option to separate the multiple ranges by a semi-colon instead of a comma (something we want to make more standard in AsciiDoc).
 

And tell me where I should open an issue (documentation or implementation)?

This would be a good note to add in the documentation. Something in this area:


In fact, the manual is incorrect at the moment because it doesn't quote the attribute value. So that's definitely a bug in the documentation.

Cheers,

Reply | Threaded
Open this post in threaded view
|

Re: Include directive by line range with multiple ranges not working

Jeremie Bresson
Pull request 378 opened on GitHub:
https://github.com/asciidoctor/asciidoctor.org/pull/378
Reply | Threaded
Open this post in threaded view
|

Re: Include directive by line range with multiple ranges not working

mojavelinux
Administrator
Awesome! Thanks again!

-Dan

On Fri, May 1, 2015 at 12:19 AM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Pull request 378 opened on GitHub:
https://github.com/asciidoctor/asciidoctor.org/pull/378



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Include-directive-by-line-range-with-multiple-ranges-not-working-tp3056p3084.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--