Giter Site home page Giter Site logo

Option `parseImgDimensions` is actually `true` by default despite doc, and also, when `false` still behaves as if `true` about showdown HOT 2 OPEN

paviad avatar paviad commented on May 27, 2024
Option `parseImgDimensions` is actually `true` by default despite doc, and also, when `false` still behaves as if `true`

from showdown.

Comments (2)

joshiayush avatar joshiayush commented on May 27, 2024

@paviad In my opinion the desired behaviour with parseImgDimensions set to false shouldn't result in the following html:

<p>![my image](./pic/pic1_50.png =100pxx20px)</p>
<p>![my image2][1]</p>
<p>[1]: ./pic/pic1_50.png =100pxx20px</p>

It should rather just omit the dimensions and fill in the html with proper values while leaving the dimension attributes, like the following:

<p><img src="./pic/pic1_50.png" alt="my image" /></p>
<p><img src="./pic/pic1_50.png" alt="my image2" /></p>

Because the important point to note here is that if we're setting parseImgDimensions to false that means we want the image to be displayed in its original dimensions regarding of the dimensions provided in the markdown syntax.

Note, we still want the image to be displayed but, not with the dimension attributes.

And the fix you've provided here #985 (which is highly appreciated) does not let the image render rather it just puts the markdown syntax in its place which is not the desired behaviour of a markdown to html converter.

I hope you'll look into it and you'll try to come up with a different approach.

from showdown.

paviad avatar paviad commented on May 27, 2024

It is definitely a viable alternative to my design - I can make it so.

from showdown.

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.