Micron Document
recent errors to remember - alt text in fences

Apparently Pandoc is picky about what would otherwise be the alt text for a code block. My measuring stick has become to call Pandoc with a destination of T383838-t markdown_strict so that it will show me the markdown it thinks it just parsed. I'm occasionally surprised by the results.

For example, this is entirely valid:

T282828
echo foo

This will produce the following in T383838pandoc -t markdown_strict:

echo foo

Now here's what it does with some of my (not fixed) notes...

T282828
#!/bin/bash
##
# This script does blah blah blah
. settings.sh
# more content...

And that will get butchered like this:

T383838bash file: touch.sh #!/bin/bash ## # This script does blah blah blah . settings.sh # more content...

Instead of a fence, it's apparently an empty inline code segment followed by some more inline code, and since it's not a fence, it will condense the whitespaces.

My intention was to create a fence, indicate that it was bash syntax, and put the name in a convenient location. That didn't work out so well.

This is also fine:

T282828
T8b949e#!/bin/bash
T8b949e##
T8b949e# More comments...
funTff7b72(Tff7b72)Tff7b72{
Tffa657local Te6edf3FOOTff7b72=Tffd700${Te6edf31Tffd700}
Tffa657echo Ta5d6ff"Tffd700${#Te6edf3FOOTffd700}Ta5d6ff"
Tff7b72}


It will correctly become this:

#!/bin/bash
##
# More comments...
fun(){
local FOO=${1}
echo "${#FOO}"
}

And this is not fine.

T282828
#!/bin/bash
##
# More comments...
fun(){
local FOO=Tff7b72${T79c0ff1Tff7b72}
echo "Tff7b72${T8b949e#FOOTff7b72}"
}


It will similarly become:

T383838bash script: foo.sh #!/bin/bash ## # More comments... fun(){ local FOO=${1} echo "${#FOO}" }

To summarize, these are all valid fence beginnings:

T282828
And these are not valid because of the additional words:


I had started putting a sentence at the beginning of the fence to act as alt text because I didn't realize it was invalid.

I don't know where using a sentence as the first line for alt text came from, but it's not a thing and I should stop trying to do it.

Tags: meta

Tags
Navigation



created: 2023-04-20

updated: 2023-04-26 22:22:38

(re)generated: 2026-07-17