Giter Club home page Giter Club logo

Comments (10)

Saul-Mirone avatar Saul-Mirone commented on June 10, 2024 1

Is the escaping of square brackets intentional, or is it a bug that will be resolved at some point? I'm writing a plugin for wiki links, which uses square brackets. Is the expectation that I need to write an InputRule that removes escaped brackets?

Is plugin-automd now required for commonmark support? It doesn't appear to be documented, but links no longer work with the commonmark preset alone.

  1. The escaped brackets is introduced by remark, it will add escape mark to squre bracket to make sure the brackets won't be parsed as links.

  2. If you really want to inseart a link instead of bracket, there're a lot of methods to do that. For example, an inputrule should be created to convert patterns like [\w+](\w+) into links. You can also use a shortcut to add link to the selected text.

  3. For plugin-automd. It tries to reparse everything in user input and it will introduce other issues. So I split it out from preset-commonmark to let users to decide if they need to use it. I plan to add another inputrule for links but I just didn't get time to do that. I'm working on the @milkdown/components and @milkdown/crepe libraries.

from milkdown.

bent2685 avatar bent2685 commented on June 10, 2024

image

from milkdown.

bsdayo avatar bsdayo commented on June 10, 2024

Meeting the same problem, cannot type any links.

image

from milkdown.

chainlist avatar chainlist commented on June 10, 2024

Same here.

@Saul-Mirone do you have a plan/idea how to fix this?

from milkdown.

ravi-ojha avatar ravi-ojha commented on June 10, 2024

image

Same issue (but trailing slash) with using Shift+Enter and then typing anything.

Edit: Found syntax-tree/mdast-util-to-markdown#45
It looks intentional for this trailing slash. Although, this is not standard markdown syntax.

from milkdown.

DanielPower avatar DanielPower commented on June 10, 2024

I'm seeing this as well. If I include a [ in the initial value, it is parsed correctly and links work. But if a [ is typed into the editor, it is escaped with \. This means links are impossible to create in the editor, including in the Playground.

from milkdown.

DanielPower avatar DanielPower commented on June 10, 2024

I've tested that this issue was introduced in 7.3.3 and still exists in 7.3.6. Reverting to 7.3.2 resolves the problem.

from milkdown.

Saul-Mirone avatar Saul-Mirone commented on June 10, 2024

I've tested that this issue was introduced in 7.3.3 and still exists in 7.3.6. Reverting to 7.3.2 resolves the problem.

That part was extracted as @milkdown/plugin-automd. You can install the plugin and enable it.

from milkdown.

DanielPower avatar DanielPower commented on June 10, 2024

Is the escaping of square brackets intentional, or is it a bug that will be resolved at some point? I'm writing a plugin for wiki links, which uses square brackets. Is the expectation that I need to write an InputRule that removes escaped brackets?

Is plugin-automd now required for commonmark support? It doesn't appear to be documented, but links no longer work with the commonmark preset alone.

from milkdown.

bent2685 avatar bent2685 commented on June 10, 2024

@Saul-Mirone
Thank you! I took your advice and added @milkdown/plugin-automd, then enabled it, which fixed the problem.

from milkdown.

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.