emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug report: export to HTML does not escape * in example
@ 2017-02-27  1:00 dmg
  2017-02-27  7:40 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: dmg @ 2017-02-27  1:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

The following example:


* Example

#+begin_example
hello world
#+end_example

#+begin_example
* hello world
#+end_example

exports an HTML file where the second "hello word" is interpreted as a
header, ignoring that it is within begin_example. See below

I am using org-mode version 9.0.3, under emacs-25.


<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org4937d33">1. Example</a></li>
<li><a href="#org774a613">2. hello world 2</a></li>
</ul>
</div>
</div>
<div id="outline-container-org4937d33" class="outline-2">
<h2 id="org4937d33"><span class="section-number-2">1</span> Example</h2>
<div class="outline-text-2" id="text-1">
<pre class="example">
hello world 1
</pre>

<p>
#+begin<sub>example</sub>
</p>
</div>
</div>
<div id="outline-container-org774a613" class="outline-2">
<h2 id="org774a613"><span class="section-number-2">2</span> hello world
2</h2>
<div class="outline-text-2" id="text-2">
<p>
#+end<sub>example</sub>
</p>
</div>
</div>
</div>




-- 
--dmg

---
Daniel M. German
http://turingmachine.org

[-- Attachment #2: Type: text/html, Size: 5227 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-02-27  1:00 Bug report: export to HTML does not escape * in example dmg
@ 2017-02-27  7:40 ` Nicolas Goaziou
  2017-02-27  8:24   ` dmg
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2017-02-27  7:40 UTC (permalink / raw)
  To: dmg; +Cc: emacs-orgmode

Hello,

dmg <dmg@turingmachine.org> writes:

> The following example:
>
>
> * Example
>
> #+begin_example
> hello world
> #+end_example
>
> #+begin_example
> * hello world
> #+end_example
>
> exports an HTML file where the second "hello word" is interpreted as a
> header, ignoring that it is within begin_example. See below

A star at the beginning of a line is always a headline. It has
precedence over the block around it. You need to escape the star
character:

  #+begin_example
  ,* hello world
  #+end_example

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-02-27  7:40 ` Nicolas Goaziou
@ 2017-02-27  8:24   ` dmg
  2017-02-27 17:57     ` Charles C. Berry
  0 siblings, 1 reply; 9+ messages in thread
From: dmg @ 2017-02-27  8:24 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

On Sun, Feb 26, 2017 at 11:40 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

>
> A star at the beginning of a line is always a headline. It has
> precedence over the block around it. You need to escape the star
> character:
>
>   #+begin_example
>   ,* hello world
>   #+end_example
>
> Regards,


​Thank you. I guess the issue is then with org-babel.

I am running a babel script that generates, as one of its line * in the
front:

​#+BEGIN_SRC sh
echo "* Hello"
#+END_SRC

#+RESULTS:
#+begin_example
* Hello
#+end_example

​In that case, should babel be the one escaping the * in the RESULTS block?

thanks again,

--daniel​




-- 
--dmg

---
Daniel M. German
http://turingmachine.org

[-- Attachment #2: Type: text/html, Size: 2855 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-02-27  8:24   ` dmg
@ 2017-02-27 17:57     ` Charles C. Berry
  2017-02-27 19:04       ` Nick Dokos
  2017-03-01 20:04       ` D M German
  0 siblings, 2 replies; 9+ messages in thread
From: Charles C. Berry @ 2017-02-27 17:57 UTC (permalink / raw)
  To: dmg; +Cc: emacs-orgmode, Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

On Mon, 27 Feb 2017, dmg wrote:

> On Sun, Feb 26, 2017 at 11:40 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
> wrote:
>
>>
>> A star at the beginning of a line is always a headline.

[...]

>
> ​Thank you. I guess the issue is then with org-babel.
>
> I am running a babel script that generates, as one of its line * in the
> front:
>
> ​#+BEGIN_SRC sh
> echo "* Hello"
> #+END_SRC
>
> #+RESULTS:
> #+begin_example
> * Hello
> #+end_example
>
> ​In that case, should babel be the one escaping the * in the RESULTS block?

Is that *really* what it did?

When I run your example, I get:

#+RESULTS:
: * Hello

and this exports (with the `:exports results' header) to html wrapped 
in a <pre class="example"> container:

<pre class="example">
* Hello
</pre>

using Org 9.0.5.

Without that header the src code gets wrapped in a <pre> container.

So there must be something in/about your setup you haven't mentioned.

HTH,

Chuck

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-02-27 17:57     ` Charles C. Berry
@ 2017-02-27 19:04       ` Nick Dokos
  2017-03-01 20:04       ` D M German
  1 sibling, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2017-02-27 19:04 UTC (permalink / raw)
  To: emacs-orgmode

"Charles C. Berry" <ccberry@ucsd.edu> writes:

> On Mon, 27 Feb 2017, dmg wrote:
>
>> On Sun, Feb 26, 2017 at 11:40 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
>> wrote:
>>
>>>
>>> A star at the beginning of a line is always a headline.
>
> [...]
>
>>
>> ​Thank you. I guess the issue is then with org-babel.
>>
>> I am running a babel script that generates, as one of its line * in the
>> front:
>>
>> ​#+BEGIN_SRC sh
>> echo "* Hello"
>> #+END_SRC
>>
>> #+RESULTS:
>> #+begin_example
>> * Hello
>> #+end_example
>>
>> ​In that case, should babel be the one escaping the * in the RESULTS block?
>
> Is that *really* what it did?
>
> When I run your example, I get:
>
> #+RESULTS:
> : * Hello
>
> and this exports (with the `:exports results' header) to html wrapped
> in a <pre class="example"> container:
>
> <pre class="example">
> * Hello
> </pre>
>
> using Org 9.0.5.
>
> Without that header the src code gets wrapped in a <pre> container.
>
> So there must be something in/about your setup you haven't mentioned.
>

Probably org-babel-min-lines-for-block-output is set to a small value,
maybe 0 (?)

-- 
Nick

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-02-27 17:57     ` Charles C. Berry
  2017-02-27 19:04       ` Nick Dokos
@ 2017-03-01 20:04       ` D M German
  2017-03-01 21:20         ` Nicolas Goaziou
  1 sibling, 1 reply; 9+ messages in thread
From: D M German @ 2017-03-01 20:04 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: emacs-orgmode, Nicolas Goaziou

 
Hi Charles, everybody,

 >> I am running a babel script that generates, as one of its line * in the
 >> front:
 >> 
 >> ​#+BEGIN_SRC sh
 >> echo "* Hello"
 >> #+END_SRC
 >> 
 >> #+RESULTS:
 >> #+begin_example
 >> * Hello
 >> #+end_example
 >> 
 >> ​In that case, should babel be the one escaping the * in the RESULTS block?

 Charles> Is that *really* what it did?

 Charles> When I run your example, I get:

 Charles> #+RESULTS:
 Charles> : * Hello

 Charles> and this exports (with the `:exports results' header) to html wrapped in a <pre class="example"> container:

 Charles> <pre class="example">
 Charles> * Hello
 Charles> </pre>

 Charles> using Org 9.0.5.

 Charles> Without that header the src code gets wrapped in a <pre> container.

 Charles> So there must be something in/about your setup you haven't mentioned.

 Charles> HTH,

 Charles> Chuck




I looked a bit into my configuration. In my configuration, I set the value of 
org-babel-min-lines-for-block-output to 0.

The default value of this variable is by default 10.

When the number of lines in the output is larger than it, it uses
EXAMPLE blocks rather than the escaped ones.

So the original issue (* not being escaped) will nonetheless appear when
the threshold is passed:

Here is an example (I run it with emacs -nw -q, using emacs25) org
version 8.2.10 (this works also in my configuration under 9.0.2)

#+BEGIN_SRC emacs-lisp :results output
(dotimes (i 2) (print '*hello))
#+END_SRC

#+RESULTS:
: 
: *hello
: 
: *hello


#+BEGIN_SRC emacs-lisp :results output
(dotimes (i 10) (print '*hello))
#+END_SRC

#+RESULTS:
#+begin_example

*hello

*hello

*hello

*hello

*hello
#+end_example


 

thank you all again,

--
Daniel M. German                  "Cyberspace. A consensual hallucination
                                   experienced daily by billions
   William Gibson ->               of legitimate operators in every nation"
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-03-01 20:04       ` D M German
@ 2017-03-01 21:20         ` Nicolas Goaziou
  2017-03-03 19:06           ` Charles C. Berry
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2017-03-01 21:20 UTC (permalink / raw)
  To: D M German; +Cc: emacs-orgmode, Charles C. Berry

Hello,

D M German <dmg@turingmachine.org> writes:

> So the original issue (* not being escaped) will nonetheless appear when
> the threshold is passed:
>
> Here is an example (I run it with emacs -nw -q, using emacs25) org
> version 8.2.10 (this works also in my configuration under 9.0.2)
>
> #+BEGIN_SRC emacs-lisp :results output
> (dotimes (i 2) (print '*hello))
> #+END_SRC
>
>
> #+RESULTS: : : *hello : : *hello
>
> #+BEGIN_SRC emacs-lisp :results output
> (dotimes (i 10) (print '*hello))
> #+END_SRC
>
>
> #+RESULTS:
>
> #+begin_example
>
> *hello
>
> *hello
>
> *hello
>
> *hello
>
> *hello
> #+end_example

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-03-01 21:20         ` Nicolas Goaziou
@ 2017-03-03 19:06           ` Charles C. Berry
  2017-03-05 17:06             ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Charles C. Berry @ 2017-03-03 19:06 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: D M German, emacs-orgmode

On Wed, 1 Mar 2017, Nicolas Goaziou wrote:

> Hello,
>
> D M German <dmg@turingmachine.org> writes:
>
>> So the original issue (* not being escaped) will nonetheless appear when
>> the threshold is passed:
>>
>
> Fixed. Thank you.
>

Hmmm. Now I get

:    FAILED  test-ob/org-babel-insert-result

for make test2, which appears to be from trying to match

",\\* Not an headline" "

to

#+RESULTS:
: * Not an headline

in test-ob/org-babel-insert-result

HTH,

Chuck

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug report: export to HTML does not escape * in example
  2017-03-03 19:06           ` Charles C. Berry
@ 2017-03-05 17:06             ` Nicolas Goaziou
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2017-03-05 17:06 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: D M German, emacs-orgmode

Hello,

"Charles C. Berry" <ccberry@ucsd.edu> writes:

> On Wed, 1 Mar 2017, Nicolas Goaziou wrote:
>
>> Hello,
>>
>> D M German <dmg@turingmachine.org> writes:
>>
>>> So the original issue (* not being escaped) will nonetheless appear when
>>> the threshold is passed:
>>>
>>
>> Fixed. Thank you.
>>
>
> Hmmm. Now I get
>
> :    FAILED  test-ob/org-babel-insert-result
>
> for make test2, which appears to be from trying to match
>
> ",\\* Not an headline" "
>
> to
>
> #+RESULTS:
> : * Not an headline
>
> in test-ob/org-babel-insert-result

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-03-05 17:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-27  1:00 Bug report: export to HTML does not escape * in example dmg
2017-02-27  7:40 ` Nicolas Goaziou
2017-02-27  8:24   ` dmg
2017-02-27 17:57     ` Charles C. Berry
2017-02-27 19:04       ` Nick Dokos
2017-03-01 20:04       ` D M German
2017-03-01 21:20         ` Nicolas Goaziou
2017-03-03 19:06           ` Charles C. Berry
2017-03-05 17:06             ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).