Giter VIP home page Giter VIP logo

Comments (3)

Gazook89 avatar Gazook89 commented on September 25, 2024 1

I think the issue is a bad regex.

in markdown.js:

	const inlineDefRegex  = /([!$]?\[((?!\s*\])(?:\\.|[^\[\]\\])+)\])\(([^\n]+)\)/;                         //Matches 8, 9[10](11)

should be changed to

	const inlineDefRegex  = /([!$]?\[((?!\s*\])(?:\\.|[^\[\]\\])+)\])\(([^\n)]+)\)/;                         //Matches 8, 9[10](11)

which adds a ) in the disallowed characters in the third matching group (([^\n)]+))

image

from homebrewery.

5e-Cleric avatar 5e-Cleric commented on September 25, 2024

@Gazook89 has reportedly tried this combination in other markdown editors without being able to replicate this behaviour, therefore, we are drawn to the conclusion the bug must come from our own code, most likely our table handling code in \shared\naturalcrit\markdown.js.

Pointed out by @calculuschild, the error might be new and related to variables.

from homebrewery.

calculuschild avatar calculuschild commented on September 25, 2024

Discussed on Gitter, the real issue is this:

As easy as let content = match[11] ? match[11] : null;, just removing the trim and regex substitution, since we need to do the parenthesis matching to occur before the trim.

let content = match[11] ? match[11].trim().replace(/\s+/g, ' ') : null; // Trim edge spaces and shorten blocks of whitespace to 1 space

The trim will then happen afterward here. Note that the if(i > -1) will always be true since there is no opportunity for i to be equal or less than -1. That was leftover from an earlier piece of code, and so we can just pull the inside of the if out.

if(i > -1) {
combinedRegex.lastIndex = combinedRegex.lastIndex - (content.length - i);
content = content.slice(0, i).trim().replace(/\s+/g, ' ');
}

from homebrewery.

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.