MarkBind / markbind

MarkBind is a tool for generating content-heavy websites from source files in Markdown format
https://markbind.org/
MIT License
135 stars 124 forks source link

Unspecified behavior of using `<span>` with boilerplate #1847

Open tlylt opened 2 years ago

tlylt commented 2 years ago

Tell us about your environment Windows

What did you do? Please include the actual source code causing the issue. When adjusting span tags to prevent invalid wrapping of block-level elements, I discovered that in our docs we have this boilerplate: docs\_markbind\boilerplates\tip.md

<box border-left-color="{{ markbind_blue }}">

{{ icon_bulb_blue }} {{ tip_body | safe }}
</box>

This displays the content of tip_body "variable" within a box.

Some places that use it include the getting started page: docs\userGuide\gettingStarted.md

<include src="tip.md" boilerplate >
<span id="tip_body">
You can add the `--help` flag to any command to show the help screen. <br>
  e.g., `markbind init --help`
</span>
</include>

When changing the <span> to a <div>, it stops working.

<include src="tip.md" boilerplate >
<div id="tip_body">
You can add the `--help` flag to any command to show the help screen. <br>
  e.g., `markbind init --help`
</div>
</include>

What did you expect to happen? image

What actually happened? Please include the actual, raw output. image

I don't think there is any mention of this behavior of using <span id="tip_body"> to define a variable in our documentation(in particular, the reusing content page.)

damithc commented 2 years ago

@tlylt what if you use <variable name="tip_body"> instead of span/div?

tlylt commented 2 years ago

<variable name="tip_body">

and also <variable id="tip_body"> both ok.

Edit: <span name="tip_body"> works too

damithc commented 2 years ago

At early days of MarkBind, we used span for declaring variables. I don't think it is an advertised feature anymore. So, I guess the solution is to replace it with variable rather than div in this specific case.