* *strong* markup not honored at boundary of macro input during HTML export @ 2020-12-22 17:12 m27315 2020-12-23 14:58 ` m27315 0 siblings, 1 reply; 4+ messages in thread From: m27315 @ 2020-12-22 17:12 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/html, Size: 4313 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: *strong* markup not honored at boundary of macro input during HTML export 2020-12-22 17:12 *strong* markup not honored at boundary of macro input during HTML export m27315 @ 2020-12-23 14:58 ` m27315 2020-12-23 15:22 ` Juan Manuel Macías 0 siblings, 1 reply; 4+ messages in thread From: m27315 @ 2020-12-23 14:58 UTC (permalink / raw) To: emacs-orgmode Resending as plain-text ... If somebody could point me in the direction of the code that might be responsible for this, I'll try to take a look. .... If the following org file is exported as HTML, any *strong* markup for words at the beginning or the end of the input string are ignored. (I have included several slight variations to help testing.) #+TITLE: Test MACRO with *strong* Markup Input #+OPTIONS: date:nil timestamp:nil num:nil stat:t title:t toc:nil #+MACRO: quote @@html:<span class="quote">“@@$1@@html:”</span>@@ * Test macro with non-marked text: Demonstrating that, {{{quote(This is a vanilla quote without markup)}}}, Abraham Lincoln. {{{quote(This is a similar control quote without markup)}}}, George Washington said. * Test macro with leading *strongly* marked text: Wilson quipped, {{{quote(*Not all* quotes are important!)}}}. {{{quote(*But this* is a very important quote)}}}, Thomas Jefferson replied. * Test macro with trailing *strongly* marked text: Retorted Yoda, {{{quote(Critical if not uncertain\, all *my quotes are*)}}}. {{{quote(I am certain they are *all uncertain*)}}}, Anakin sneered. * Test macro with leading, middle, and trailing marked text: Darth Vader threatened, {{{quote(*All* of *my quotes* are *heeded carefully!*)}}}. {{{quote(*Nobody* listens to *meesa* quotes. *Why?*)}}}, Jar-Jar whined. The condensed filtered HTML output is: ... <h2 id="org40a1103">Test macro with non-marked text:</h2> <p>Demonstrating that, <span class="quote">“This is a vanilla quote without markup”</span>, Abraham Lincoln.</p> <p><span class="quote">“This is a similar control quote without markup”</span>, George Washington said.</p> <h2 id="org962a914">Test macro with leading <b>strongly</b> marked text:</h2> <p>Wilson quipped, <span class="quote">“*Not all* quotes are important!”</span>.</p> <p><span class="quote">“*But this* is a very important quote”</span>, Thomas Jefferson replied.</p> <h2 id="org47bf84f">Test macro with trailing <b>strongly</b> marked text:</h2> <p>Retorted Yoda, <span class="quote">“Critical if not uncertain, all *my quotes are*”</span>.</p> <p><span class="quote">“I am certain they are *all uncertain*”</span>, Anakin sneered.</p> <h2 id="org08c1694">Test macro with leading, middle, and trailing marked text:</h2> <p>Darth Vader threatened, <span class="quote">“*All* of <b>my quotes</b> are *heeded carefully!*”</span>.</p> <p><span class="quote">“*Nobody* listens to <b>meesa</b> quotes. *Why?*”</span>, Jar-Jar whined.</p> ... Notice how the *strong* marks are only transformed into <b></b> tags inside a string, not at the boundaries. Can anybody confirm or explain what I am doing wrong? Thanks! Trevor ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: *strong* markup not honored at boundary of macro input during HTML export 2020-12-23 14:58 ` m27315 @ 2020-12-23 15:22 ` Juan Manuel Macías [not found] ` <7e5e7cbe-31d6-2d9e-e450-9c1b54dba95e@gmail.com> 0 siblings, 1 reply; 4+ messages in thread From: Juan Manuel Macías @ 2020-12-23 15:22 UTC (permalink / raw) To: m27315; +Cc: orgmode Hello, a possible dirty solution could be defining the macro with two Unicode zero-width spaces (u+200b): #+MACRO: quote (eval (concat "@@html:<span class=\"quote\">“@@" "\u200B" $1 "\u200B" "@@html:”</span>@@")) Regards, Juan Manuel m27315 <m27315@gmail.com> writes: > Resending as plain-text ... If somebody could point me in the direction of > the code that might be responsible for this, I'll try to take a look. > > .... > > If the following org file is exported as HTML, any *strong* markup for words > at the beginning or the end of the input string are ignored. (I have > included several slight variations to help testing.) > > #+TITLE: Test MACRO with *strong* Markup Input > #+OPTIONS: date:nil timestamp:nil num:nil stat:t title:t toc:nil > > #+MACRO: quote @@html:<span class="quote">“@@$1@@html:”</span>@@ > > * Test macro with non-marked text: > Demonstrating that, {{{quote(This is a vanilla quote without markup)}}}, > Abraham Lincoln. > > {{{quote(This is a similar control quote without markup)}}}, George > Washington said. > > * Test macro with leading *strongly* marked text: > Wilson quipped, {{{quote(*Not all* quotes are important!)}}}. > > {{{quote(*But this* is a very important quote)}}}, Thomas Jefferson replied. > > * Test macro with trailing *strongly* marked text: > Retorted Yoda, {{{quote(Critical if not uncertain\, all *my quotes are*)}}}. > > {{{quote(I am certain they are *all uncertain*)}}}, Anakin sneered. > > * Test macro with leading, middle, and trailing marked text: > Darth Vader threatened, {{{quote(*All* of *my quotes* are *heeded > carefully!*)}}}. > > {{{quote(*Nobody* listens to *meesa* quotes. *Why?*)}}}, Jar-Jar whined. > > The condensed filtered HTML output is: > > ... > <h2 id="org40a1103">Test macro with non-marked text:</h2> > <p>Demonstrating that, <span class="quote">“This is a vanilla > quote without markup”</span>, Abraham Lincoln.</p> > <p><span class="quote">“This is a similar control quote without > markup”</span>, George Washington said.</p> > > <h2 id="org962a914">Test macro with leading <b>strongly</b> marked > text:</h2> > <p>Wilson quipped, <span class="quote">“*Not all* quotes are > important!”</span>.</p> > <p><span class="quote">“*But this* is a very important > quote”</span>, Thomas Jefferson replied.</p> > > <h2 id="org47bf84f">Test macro with trailing <b>strongly</b> marked > text:</h2> > <p>Retorted Yoda, <span class="quote">“Critical if not uncertain, > all *my quotes are*”</span>.</p> > <p><span class="quote">“I am certain they are *all > uncertain*”</span>, Anakin sneered.</p> > > <h2 id="org08c1694">Test macro with leading, middle, and trailing marked > text:</h2> > <p>Darth Vader threatened, <span class="quote">“*All* of <b>my > quotes</b> are *heeded carefully!*”</span>.</p> > <p><span class="quote">“*Nobody* listens to <b>meesa</b> quotes. > *Why?*”</span>, Jar-Jar whined.</p> > ... > > Notice how the *strong* marks are only transformed into <b></b> tags inside > a string, not at the boundaries. > > Can anybody confirm or explain what I am doing wrong? > > Thanks! > > Trevor > > ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <7e5e7cbe-31d6-2d9e-e450-9c1b54dba95e@gmail.com>]
* Re: *strong* markup not honored at boundary of macro input during HTML export [not found] ` <7e5e7cbe-31d6-2d9e-e450-9c1b54dba95e@gmail.com> @ 2020-12-23 16:05 ` Juan Manuel Macías 0 siblings, 0 replies; 4+ messages in thread From: Juan Manuel Macías @ 2020-12-23 16:05 UTC (permalink / raw) To: m27315; +Cc: orgmode You're welcome. Some time ago I had a similar problem with a LaTeX command with arguments that I wanted to include in a macro. Since the character U+200b is a kind of "ghost space", it can act as an "invisible barrier" between the emphasis marks and the characters that precede or follow them. An emergency cure ;-) Regards, Juan Manuel m27315 <m27315@gmail.com> writes: > Worked like a charm. Thanks, Juan! > > On 2020-12-23 9:22 AM, Juan Manuel Macías wrote: >> quote (eval (concat "@@html:<span class=\"quote\">“@@" "\u200B" $1 "\u200B" "@@html:”</span>@@")) > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-23 16:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-12-22 17:12 *strong* markup not honored at boundary of macro input during HTML export m27315 2020-12-23 14:58 ` m27315 2020-12-23 15:22 ` Juan Manuel Macías [not found] ` <7e5e7cbe-31d6-2d9e-e450-9c1b54dba95e@gmail.com> 2020-12-23 16:05 ` Juan Manuel Macías
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).