Skip to content

<pre> without <code> should be skipped #68

@m4rrc0

Description

@m4rrc0

Hey.

First I want to thank you for this tool. Pretty neat to be able to draw graphs so easily with zero client-side JS!

Here is the issue I encountered.

from-html expects every <pre> tag to have a <code> tag inside. While it is a common practice, it is not the only use for a <pre> tag so this tool should probably just skip any kind of rendering then.

The unexpected error comes from this line.

I am using the Eleventy plugin and this is the error I get.

[11ty] Eleventy Fatal Error (CLI):
[11ty] 1. Having trouble writing to "./dist/demo-html5/index.html" from "_content/en/pages/demo-html5.md" (via EleventyTemplateError)
[11ty] 2. Transform `codeblocks-eleventy-plugin` encountered an error when transforming _content/en/pages/demo-html5.md. (via EleventyTransformError)
[11ty] 3. undefined is not an object (evaluating 'noCode.split') (via TypeError)
error: "eleventy" exited with code 1

I get this on a test md file with mostly html inside and the problem appears for this part of the file.

<pre>P R E F O R M A T T E D T E X T
! " # $ % &amp; ' ( ) \* + , - . /
0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
\` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } \~ </pre>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions