Coder Social home page Coder Social logo

Comments (21)

pmario avatar pmario commented on June 8, 2024

Your text and your screenshot are not the same thing.

For me it looks like this. FireFox Windows 11 -- markdown tiddler.

I can recreate a problem. I did use <demo> for the screenshot. -- It seems to be a bug.

image

from tiddlywiki5.

pmario avatar pmario commented on June 8, 2024

The parse-tree looks like this

[
    {
        "type": "element",
        "start": 0,
        "attributes": {
            "class": {
                "start": 4,
                "name": "class",
                "type": "string",
                "value": "markdown",
                "end": 21
            }
        },
        "orderedAttributes": [
            {
                "start": 4,
                "name": "class",
                "type": "string",
                "value": "markdown",
                "end": 21
            }
        ],
        "tag": "div",
        "end": 22,
        "isBlock": false,
        "children": [
            {
                "type": "text",
                "text": "\n",
                "start": 22,
                "end": 23
            },
            {
                "type": "element",
                "start": 23,
                "attributes": {},
                "orderedAttributes": [],
                "tag": "demo",
                "end": 29,
                "isBlock": false,
                "children": [
                    {
                        "type": "text",
                        "text": "</div>",
                        "start": 29,
                        "end": 35
                    }
                ]
            }
        ]
    }
]

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Recently, when I was investigating why the my personal plugin library did not work, I found that if there is a <body></body> text in the plugin's readme, there will be parsing problems. This is the third time I have encountered problems with parser bug three times.

img

from tiddlywiki5.

pmario avatar pmario commented on June 8, 2024

hmm, IMO there should be no <body></body> in any tiddler other than some templates. </body> is probably misinterpreted on the browser side and not necessarily from the TW parser

See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body

The HTML element represents the content of an HTML document. There can be only one element in a document.

from tiddlywiki5.

Jermolene avatar Jermolene commented on June 8, 2024

Recently, when I was investigating why the my personal plugin library did not work, I found that if there is a <body></body> text in the plugin's readme, there will be parsing problems. This is the third time I have encountered problems with parser bug three times.

Hi @oeyoews that sounds intriguing, could you give a little more information so that I can replicate the problem?

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Whether the body tag is in a codeblock or a comment, it will cause the built plugin library error. I think this may be a codeblock problem.

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Recently, when I was investigating why the my personal plugin library did not work, I found that if there is a <body></body> text in the plugin's readme, there will be parsing problems. This is the third time I have encountered problems with parser bug three times.

Hi @oeyoews that sounds intriguing, could you give a little more information so that I can replicate the problem?

I use the local plugin library for testing, build a plugin library arbitrarily, write the body tag on the plugin readme, and open the home page of the plugin library๏ผŒ such as xxx/library/index.html. You should be able to see the problem

from tiddlywiki5.

Jermolene avatar Jermolene commented on June 8, 2024

Hi @oeyoews I added <body></body> to $:/plugins/tiddlywiki/markdown/readme, and then built the plugin library with tiddlywiki editions/pluginlibrary --build library. I viewed the resulting ./wiki/output/index.html in Chrome and couldn't see any issues. I can see the <body></body> in the source via dev tools.

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

@Jermolene https://github.com/oeyoews/tw-parser-bug I created a minimally reproduced git repository

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Hi @oeyoews I added <body></body> to $:/plugins/tiddlywiki/markdown/readme, and then built the plugin library with tiddlywiki editions/pluginlibrary --build library. I viewed the resulting ./wiki/output/index.html in Chrome and couldn't see any issues. I can see the <body></body> in the source via dev tools.

If you use Chrome to open this index.html directly, you can't see any problem. If you use http-server to open it, you can see this problem.

from tiddlywiki5.

Jermolene avatar Jermolene commented on June 8, 2024

Thanks @oeyoews I followed your instructions but still can't see the problem in Chrome:

Screenshot 2023-10-14 at 18 28 39

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

This seems to be a problem with live-server. If it encounters a body tag in a script tag, it will insert a piece of script code, which causes the js part of the code to fail; this also explains why it is normal to open the file directly.
img

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Describe the bug

If you encounter angle brackets in markdown, there will be problems with parsing

Expected behavior

No response

To Reproduce

open the website https://tiddlywiki.com/editions/full/, add new markdown tiddler and input<demo>

Screenshots

img

TiddlyWiki Configuration

  • Version [e.g. v5.1.24]
  • Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
  • Plugins installed [e.g. Freelinks, TiddlyMap]

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

No response

This problem is caused by the new markdowncha plug-in. There is no problem when using markdow-leagcy.

image

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

<id> is recognized as an unclosed tag, and it will be normal if added

image

from tiddlywiki5.

Jermolene avatar Jermolene commented on June 8, 2024

This seems to be a problem with live-server. If it encounters a body tag in a script tag, it will insert a piece of script code, which causes the js part of the code to fail; this also explains why it is normal to open the file directly.

Thanks @oeyoews that makes sense.

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Another similar question, is there any special treatment for input tag?

<input type="checkbox" id="cbx_0" checked="true" disabled="true" >test</input>

image

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

<input type="checkbox" id="cbx_0" checked="true" disabled="true"/> maybe should use selfclose tag

from tiddlywiki5.

CodaCodr avatar CodaCodr commented on June 8, 2024

/> is not needed on <input> since it has no corresponding end tag: it's a void element (an element that cannot contain content), so closing a void element with /> makes no real sense.

In the case of <input>, MDN uses variously > and /> while the spec only uses > so far as I've seen.

from tiddlywiki5.

oeyoews avatar oeyoews commented on June 8, 2024

Some unofficial markdown-it plugins allow writing content in <input> tags. I accidentally discovered this, but it seems that HTML is compatible with this syntax(but tiddlywiki not)

from tiddlywiki5.

CodaCodr avatar CodaCodr commented on June 8, 2024

That's more the case that browsers are forgiving. For the most part, the specs are clear. And full marks to TiddlyWiki. ๐Ÿ‘

from tiddlywiki5.

pmario avatar pmario commented on June 8, 2024

Some unofficial markdown-it plugins allow writing content in tags. I accidentally discovered this, but it seems that HTML is compatible with this syntax(but tiddlywiki not)

From time to time it would make sense to read the docs, instead of "butchering" the HTML syntax.

see: input checkbox

from tiddlywiki5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.