Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using image references #585

Closed
pgengler opened this issue Sep 12, 2018 · 5 comments · May be fixed by coderbyheart/contentful-static-website-generator#6
Closed

Error when using image references #585

pgengler opened this issue Sep 12, 2018 · 5 comments · May be fixed by coderbyheart/contentful-static-website-generator#6
Assignees

Comments

@pgengler
Copy link

When using a markdown image that specifies the image URL via a footnote/reference, such as:

[![the-image]]

[the-image]: http://example.com/foo.png

the converter throws an error:

Uncaught TypeError: title.replace is not a function
    at writeImageTag (showdown.js:3702)
    at String.replace (<anonymous>)
    at showdown.js:3736
    at showdown.js:4191
    at showdown.js:4109
    at showdown.js:2844
    at showdown.Converter.makeHtml (showdown.js:2464)

Reproducible in this JSFiddle using 1.8.6; I was also reproduce it locally with the master branch (2.0.0-alpha.1).

(GFM reference for this usage)

@tivie tivie self-assigned this Sep 14, 2018
@tivie tivie closed this as completed in 63763b1 Sep 14, 2018
tivie added a commit that referenced this issue Sep 14, 2018
In some circumstances, on a reference style image, the last capturing
group is ignored, which causes the fucntion argument to return the number
of matches instead of a string (or undefined).
Checking if the title parameter is a string ensures that the title
parameter is actually something that was caught by the regex and not some
metadata.

Closes #585
@tivie tivie mentioned this issue Sep 14, 2018
@tivie
Copy link
Member

tivie commented Sep 15, 2018

Should be fixed now.

@pgengler can you please test if it's working for you?


Donate Click here to lend your support to: ShowdownJS website and testing platform and make a donation at paypal.com

As you know, ShowdownJS is a free library and it will remain free forever. However, maintaining and improving the library costs time and money.
If you like our work and find our library useful, please donate through Pledgie or directly through paypal!! Your contribution will be greatly appreciated and help us continue to develop this awesome library.

tivie added a commit that referenced this issue Oct 16, 2018
In some circumstances, on a reference style image, the last capturing
group is ignored, which causes the fucntion argument to return the number
of matches instead of a string (or undefined).
Checking if the title parameter is a string ensures that the title
parameter is actually something that was caught by the regex and not some
metadata.

Closes #585
@yuanjilee
Copy link

new version the issue is still exist

image

@tivie
Copy link
Member

tivie commented Dec 20, 2018

Which version?

@yuanjilee
Copy link

@tivie

Which version?

with the http://demo.showdownjs.com/ test, is it the newest version?

test data: ![[image] image](https://pbs.twimg.com/profile_images/704817777404743681/RNNOWR3X.jpg)

@tivie
Copy link
Member

tivie commented Dec 28, 2018

@yuanjilee The issue you report is not related to this one. It has to do with "parentheses priority".

You should open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants