Hello Nicolas,

2015-10-23 22:37 GMT+02:00 Nicolas Goaziou <m...@nicolasgoaziou.fr>:

> Hello,
>
> Fabrice Popineau <fabrice.popin...@gmail.com> writes:
>
> > I was wondering if macros could be used to output raw html code, but that
> > doesn't seem to be the case.
> >
> > Namely:
> >
> > #+macro: bfoo @@html:<div class"foo">@@
> > #+macro: efoo @@html:</div>@@
> >
> > The macros {{{bfoo}}} and {{{efoo}}} are expanded surrounded by <p> ...
> > </p>.
>
> Macros can output raw inline HTML code. If you want to generate any HTML
> code, you can use some babel block to do that.
>
>
I agree that raw html can be output by macros, but it can easily break too.

At the moment :

---------------------------------------------------------------------------------------------
#+macro: bfoo @@html:<div class"foo">@@
#+macro: efoo @@html:</div>@@

* Section

{{{bfoo}}}

Some text.

{{{efoo}}}
---------------------------------------------------------------------------------------------

is exported as :

---------------------------------------------------------------------------------------------
<div id="outline-container-orgheadline1" class="outline-2">
<h2 id="orgheadline1">Section</h2>
<div class="outline-text-2" id="text-orgheadline1">
<p>

</p>

<p>
<div class"foo">
</p>

<p>
Some text.
</p>

<p>
</div>
</p>
</div>
</div>
---------------------------------------------------------------------------------------------

But :

---------------------------------------------------------------------------------------------
#+macro: bfoo @@html:<div class"foo">@@
#+macro: efoo @@html:</div>@@

* Section

{{{bfoo}}}
Some text.
{{{efoo}}}
---------------------------------------------------------------------------------------------

is exported as :

---------------------------------------------------------------------------------------------
<div id="outline-container-orgheadline1" class="outline-2">
<h2 id="orgheadline1">Section</h2>
<div class="outline-text-2" id="text-orgheadline1">
<p>

</p>

<p>
<div class"foo">
Some text.
</div>
</p>
</div>
</div>
---------------------------------------------------------------------------------------------

In the first case, the <p> ... </p> are quite annoying.
In the second case,  the <p> ... </p> is spurious, but at least it doesn't
break the structure.

I wonder if there is a way to guess where ox-html could avoid to emit
paragraphs.

Regards,

Fabrice

Reply via email to