Giter Club home page Giter Club logo

Comments (3)

NQNStudios avatar NQNStudios commented on August 10, 2024

I did some snooping around in the SkipEscapedSubstring function and couldn't find anything that looked wrong about it. It's really weird.

from fractive.

invicticide avatar invicticide commented on August 10, 2024

Is the same \{alias} you're escaping also in use elsewhere in the same .md file in a non-escaped fashion, e.g. {alias}? Because when that's the case, I can repro this as such:

Display this as-is: \{myAlias}
But replace this one: {myAlias}

You'd expect the result to be:

Display this as-is: {myAlias}
But replace this one: foo

But what actually happens is:

Display this as-is: \foo
But replace this one: foo

The reason for that is near the end of Compiler.ReplaceAliases when we identify a non-escaped alias for replacement, we then proceed to replace all instances of that alias in the entire .md file, without checking each subsequent one for an escape. The solution to that is to replace only the alias instance we're looking at right now, instead of doing a global replace. That applies to both the regular and regex forms of replacement.

If I escape an alias that's not expanded elsewhere, it works fine, e.g.

Display this as-is: \{unusedAlias}
But replace this one: {myAlias}

...correctly displays as:

Display this as-is: {unusedAlias}
But replace this one: foo

Let me know if you're seeing a different repro for this, or a different issue altogether.

from fractive.

NQNStudios avatar NQNStudios commented on August 10, 2024

Off the top of my head, that is probably the use-case, yeah. Because I was trying to make an example that would show macro syntax and subsequently show the macro output, if I remember correctly.

from fractive.

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.