Italic and monospaced being mixed up

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

Italic and monospaced being mixed up

Mario Domenech Goulart
Hi,

asciidoctor 1.5.2 on Ruby 1.9.3p194 here.

Is the behavior shown below expected?

$ echo 'append `_` to `foo` to get `foo_`' > foo.adoc
$ asciidoctor foo.adoc -b html5 -o - | grep append
<p>append <code><em></code> to <code>foo</code> to get <code>foo</em></code></p>

Best wishes.
Mario
--
http://parenteses.org/mario
Reply | Threaded
Open this post in threaded view
|

Re: Italic and monospaced being mixed up

mojavelinux
Administrator
Mario,

Assuming the content is in a normal paragraph, this is just how AsciiDoc works at the moment. However, I think your problem can be easily solved by putting your commandline entries in a literal paragraph. You can accomplish this simply be prefixing each line with an empty space:

 $ echo 'append `_` to `foo` to get `foo_`' > foo.adoc 
 $ asciidoctor foo.adoc -b html5 -o - | grep append 

By default, no formatting substitutions are applied to a literal paragraph.

Cheers,

-Dan

On Fri, Apr 24, 2015 at 1:28 PM, Mario Domenech Goulart [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

asciidoctor 1.5.2 on Ruby 1.9.3p194 here.

Is the behavior shown below expected?

$ echo 'append `_` to `foo` to get `foo_`' > foo.adoc
$ asciidoctor foo.adoc -b html5 -o - | grep append
<p>append <code><em></code> to <code>foo</code> to get <code>foo</em></code></p>

Best wishes.
Mario
--
http://parenteses.org/mario



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Italic-and-monospaced-being-mixed-up-tp3032.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Italic and monospaced being mixed up

Mario Domenech Goulart
Hi Dan,

On Wed, 29 Apr 2015 13:02:51 -0700 (PDT) "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

> Assuming the content is in a normal paragraph, this is just how
> AsciiDoc works at the moment. However, I think your problem can be
> easily solved by putting your commandline entries in a literal
> paragraph. You can accomplish this simply be prefixing each line with
> an empty space:
>
> $ echo 'append `_` to `foo` to get `foo_`' > foo.adoc
> $ asciidoctor foo.adoc -b html5 -o - | grep append
>
> By default, no formatting substitutions are applied to a literal
> paragraph.

Thanks for your reply.

Not sure if I don't understand your reply or if my message was not clear
enough. :-)

I mean the HTML code _generated_ by

  $ echo 'append `_` to `foo` to get `foo_`' > foo.adoc
  $ asciidoctor foo.adoc -b html5 -o - | grep append

doesn't look correct:

  <p>append <code><em></code> to <code>foo</code> to get <code>foo</em></code></p>

The command lines are not part of the document.  They are just
instructions on how to reproduce the behavior I suppose is not ok.

Here's how the output is rendered (this is a screenshot of the browser
window rendering the HTML document):
http://parenteses.org/mario/misc/asciidoctor-foo.png

Best wishes.
Mario
--
http://parenteses.org/mario
Reply | Threaded
Open this post in threaded view
|

Re: Italic and monospaced being mixed up

mojavelinux
Administrator
Oops. My mistake. I now understand what you were saying.

You are likely running into the issue described here:


In short, you can either add `compat-mode` to the top of your document to get the old backtick behavior:

----
= Document Title
:compat-mode:

append `_` to `foo` to get `foo_`
----

or you can use the new syntax for literal monospace:

----
= Document Title

append `+_+` to `foo` to get `+foo_+`
----

(there are other ways too, but suffice to say the underscore has to be escaped somehow).

Cheers,

-Dan

On Thu, Apr 30, 2015 at 6:09 AM, Mario Domenech Goulart [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi Dan,

On Wed, 29 Apr 2015 13:02:51 -0700 (PDT) "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

> Assuming the content is in a normal paragraph, this is just how
> AsciiDoc works at the moment. However, I think your problem can be
> easily solved by putting your commandline entries in a literal
> paragraph. You can accomplish this simply be prefixing each line with
> an empty space:
>
> $ echo 'append `_` to `foo` to get `foo_`' > foo.adoc
> $ asciidoctor foo.adoc -b html5 -o - | grep append
>
> By default, no formatting substitutions are applied to a literal
> paragraph.
Thanks for your reply.

Not sure if I don't understand your reply or if my message was not clear
enough. :-)

I mean the HTML code _generated_ by

  $ echo 'append `_` to `foo` to get `foo_`' > foo.adoc
  $ asciidoctor foo.adoc -b html5 -o - | grep append

doesn't look correct:

  <p>append <code><em></code> to <code>foo</code> to get <code>foo</em></code></p>

The command lines are not part of the document.  They are just
instructions on how to reproduce the behavior I suppose is not ok.

Here's how the output is rendered (this is a screenshot of the browser
window rendering the HTML document):
http://parenteses.org/mario/misc/asciidoctor-foo.png

Best wishes.
Mario
--
http://parenteses.org/mario



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Italic-and-monospaced-being-mixed-up-tp3032p3071.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Italic and monospaced being mixed up

Mario Domenech Goulart
Hi Dan,

On Thu, 30 Apr 2015 12:11:13 -0700 (PDT) "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

> Oops. My mistake. I now understand what you were saying.
>
> You are likely running into the issue described here:
>
> http://asciidoctor.org/docs/migration/#migration-scenarios
>
> In short, you can either add `compat-mode` to the top of your document
> to get the old backtick behavior:
>
> ----
> = Document Title
> :compat-mode:
>
> append `_` to `foo` to get `foo_`
> ----
>
> or you can use the new syntax for literal monospace:
>
> ----
> = Document Title
>
> append `+_+` to `foo` to get `+foo_+`
> ----
>
> (there are other ways too, but suffice to say the underscore has to be
> escaped somehow).

Thanks for the examples.  Both work.

Best wishes.
Mario
--
http://parenteses.org/mario