kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Other
988 stars 147 forks source link

Inline Macros do not work as described. #361

Closed Skeeve closed 11 months ago

Skeeve commented 11 months ago

What happened?

It seems a breaking change was introduced.

An inline-macro example from the readme does not work anymore:

  <!-- Macro: <tblbox\s+(.*?)\s*>
       Template: #inline
       title: ${1}
       inline: |
           <table>
           <thead><tr><th>{{ .title }}</th></tr></thead>
           <tbody><tr><td>
        -->
  <!-- Macro: </tblbox>
       Template: #also_inline
       also_inline: |
           </td></tr></tbody></table>
        -->
  <tblbox with a title>
  and some
  content
  </tblbox>

It produces

  <table>
<thead><tr><th>{{ .title }}</th></tr></thead>
<tbody><tr><td>
<p>and some
content</p>
  </td></tr></tbody></table>

What did you expect to happen?

It should have replaced the {{ .title }}

  <table>
<thead><tr><th>with a title</th></tr></thead>
<tbody><tr><td>
<p>and some
content</p>
  </td></tr></tbody></table>

How can we reproduce the behavior you experienced?

Steps to reproduce the behavior:

  1. Create an md file with the inline macro
  2. Run mark --dry-run -f filewithmacro.md

Information (please complete the following information):

Skeeve commented 11 months ago

Seems to be a side effect of another macro I use.

Closing for now