Blank lines inside html tags

Gavin's Avatar

Gavin

23 Nov, 2021 12:46 PM

Hi,

I am using MMD with a local server (Tinyweb) and Lua.vm.js to create web pages. The ability to transclude into my Lua is very helpful. e.g.

<script src="..\js\lua.vm.js"></script>
# Lua test page
<textarea class="result" rows="22" cols="50"></textarea>
<script type="text/lua">
{{LuaInit.lua}}
{{Data.lua}}
    document:querySelector('.result').textContent = t,data["g"]
</script>

This all works and I am generally very happy - but it fails if I leave a blank line within the script tags - or in the transcluded files. Is there any way to allow blank lines in the script section?

Kind Regards Gavin Holt
PS I note the same problem with this fenced code sample

  1. Support Staff 1 Posted by fletcher on 23 Nov, 2021 02:04 PM

    fletcher's Avatar

    Blank lines within HTML tags trigger Markdown/MultiMarkdown processing inside the tags. So you'll need to strip out blank lines.

    As for fenced code, that is not the case. Blank lines are allowed in fenced code blocks. Can you provide a specific example where that does not work when using MultiMarkdown? Inserting a blank line in the code snippet above works fine for me in a fenced code block.

  2. 2 Posted by Gavin on 23 Nov, 2021 03:26 PM

    Gavin's Avatar

    Hi

    Many thanks for the clarification. I will strip/replace blank lines in my scripts/includes.
    I was simply wrong about fenced code as you say it will tolerate blank lines.

    Really enjoying playing with MMD as the CGI application for TinyWeb. I know MMD is not designed for this task, but it works very neatly and with transclusion it is very efficient.

    • Is there any way MMD can return a customizable 404 page when "file not found"

    Kind Regards Gavin Holt

  3. 3 Posted by Gavin on 23 Nov, 2021 07:46 PM

    Gavin's Avatar

    Hi

    Many thanks for your guidance you are of course completely correct.

    Kind Regards Gavin Holt

  4. Support Staff 4 Posted by fletcher on 11 Dec, 2022 07:57 PM

    fletcher's Avatar

    Sorry for the delay -- your response was sent to the spam filter... :(

    There's not really a concept of 404 for MultiMarkdown. That would need
    to be handled outside of MMD.

    Fletcher

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

11 Dec, 2022 09:57 PM
11 Dec, 2022 07:57 PM
26 Sep, 2022 02:40 AM
21 Jul, 2022 10:22 AM
11 Jan, 2022 02:33 PM

Recent Articles