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

Hyperlinks containing underscores are processed as italics #1501

Closed
evanwon opened this issue Nov 17, 2013 · 8 comments · Fixed by #8451 · May be fixed by fooiskandar/Ghost#4
Closed

Hyperlinks containing underscores are processed as italics #1501

evanwon opened this issue Nov 17, 2013 · 8 comments · Fixed by #8451 · May be fixed by fooiskandar/Ghost#4
Labels
bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost

Comments

@evanwon
Copy link

evanwon commented Nov 17, 2013

Hyperlinks that contain matched pairs of underscores are converted to italics, which breaks the hyperlink. This affects both the Live Preview editor and published content.

Ghost Version: 0.3.3

Example

Enter the following URL in the Ghost editor:

http://en.wikipedia.org/wiki/Tourism_in_Germany

Expected HTML output

<a href="http://en.wikipedia.org/wiki/Tourism_in_Germany">http://en.wikipedia.org/wiki/Tourism_in_Germany</a>

Actual HTML output

<a href="http://en.wikipedia.org/wiki/Tourism">http://en.wikipedia.org/wiki/Tourism</a><em>in</em>Germany

2013-11-17_12h36_19

@centminmod
Copy link

yeah i get that as well with Ghost 0.3.3

@evanwon
Copy link
Author

evanwon commented Nov 17, 2013

Added failing unit test in 03cd7b7

@evanwon
Copy link
Author

evanwon commented Nov 17, 2013

I believe I have fixed this issue in 03cd7b7, unit tests now passing.

@evanwon
Copy link
Author

evanwon commented Nov 17, 2013

Looks like my fix is only affecting published posts, not the Preview pane (unless I'm missing something).

@eastwood
Copy link

Yea I can confirm that it does not fix the preview pane. I'm looking into this as we speak. The problem is that editor.js only filters out image tags, it isn't set up to allow multiple regexes, checks and removals. It works by using a mark scheme.

I'll take a look at making a nice abstract factory structure to allow links and future enhancements to be made easily. The only problem i'm having though is having to constantly run grunt tasks to concatenate the .js files. Is there an easy way to keep the server running and have js files compiled together?

/cc @ErisDS

@ErisDS
Copy link
Member

ErisDS commented Jan 14, 2014

@b1nd grunt dev does that.

Please note that all of the editor bugs are currently scheduled for Milestone 0.7 - we have a big project planned to rebuild the editor in that release. You're welcome to work on it in the meantime, but all 0.4.1 and 0.5 PRs have priority.

@eastwood
Copy link

Thanks Hannah! Just noticed #1909 and thought this was the case.
Looks like there's multiple issues surrounding this. I can probably look into making the process easier, but i'll take a look at 0.4.1 and 0.5 first.

@shindakun
Copy link
Contributor

It appears this may be an issue with showdown. The showdownjs/showdown#83 PR does seem to correct the issue that @evanwon was seeing on the preview pane.

1501

@ErisDS ErisDS modified the milestone: 0.7 Editor Sep 2, 2014
ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 20, 2015
closes TryGhost#5039, TryGhost#5028, TryGhost#4659, TryGhost#4627, TryGhost#4592, TryGhost#1501

This PR pulls in the new version of showdown + adds and updates some tests to show what has changed

- Lots of additional whitespaces caused by a bad implementation of GFM newlines have been removed
- One fix with newlines + pre tags is now undone, but is now closer to all other markdown handlers
ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 20, 2015
closes TryGhost#5039, TryGhost#5028, TryGhost#4659, TryGhost#4627, TryGhost#4592, TryGhost#1501

This PR pulls in the new version of showdown + adds and updates some tests to show what has changed

- Lots of additional whitespaces caused by a bad implementation of GFM newlines have been removed
- One fix with newlines + pre tags is now undone, but is now closer to all other markdown handlers
ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 21, 2015
closes TryGhost#5039, TryGhost#5028, TryGhost#4659, TryGhost#4627, TryGhost#4592, TryGhost#1501

This PR pulls in the new version of showdown + adds and updates some tests to show what has changed

- Lots of additional whitespaces caused by a bad implementation of GFM newlines have been removed
- One fix with newlines + pre tags is now undone, but is now closer to all other markdown handlers
ErisDS added a commit to ErisDS/Ghost that referenced this issue Apr 21, 2015
closes TryGhost#5039, TryGhost#5028, TryGhost#4659, TryGhost#4627, TryGhost#4592, TryGhost#1501

This PR pulls in the new version of showdown + adds and updates some tests to show what has changed

- Lots of additional whitespaces caused by a bad implementation of GFM newlines have been removed
- One fix with newlines + pre tags is now undone, but is now closer to all other markdown handlers
ErisDS added a commit to ErisDS/Ghost that referenced this issue May 1, 2015
closes TryGhost#5039, TryGhost#5028, TryGhost#4659, TryGhost#4627, TryGhost#4592, TryGhost#1501

This PR pulls in the new version of showdown + adds and updates some tests to show what has changed

- Lots of additional whitespaces caused by a bad implementation of GFM newlines have been removed
- One fix with newlines + pre tags is now undone, but is now closer to all other markdown handlers
ErisDS added a commit to ErisDS/Ghost that referenced this issue May 2, 2015
closes TryGhost#5039, TryGhost#5028, TryGhost#4659, TryGhost#4627, TryGhost#4592, TryGhost#1501

This PR pulls in the new version of showdown + adds and updates some tests to show what has changed

- Lots of additional whitespaces caused by a bad implementation of GFM newlines have been removed
- One fix with newlines + pre tags is now undone, but is now closer to all other markdown handlers
@ErisDS ErisDS self-assigned this May 12, 2015
@ErisDS ErisDS assigned ErisDS and unassigned ErisDS Oct 9, 2015
@ErisDS ErisDS added showdown and removed affects:editor Work relating to the Koenig Editor showdown labels Mar 15, 2017
@kirrg001 kirrg001 added the server / core Issues relating to the server or core of Ghost label May 12, 2017
kirrg001 pushed a commit that referenced this issue May 15, 2017
refs TryGhost/Admin#690, closes #1501, closes #2093, closes #4592, closes #4627, closes #4659, closes #5039, closes #5237, closes #5587, closes #5625, closes #5632, closes #5822, closes #5939, closes #6840, closes #7183, closes #7536

- replace custom showdown fork with markdown-it
- swaps showdown for markdown-it when rendering markdown
- match existing header ID behaviour
- allow headers without a space after the #s
- add duplicate header ID handling
- remove legacy markdown spec
- move markdown-it setup into markdown-converter util
- update mobiledoc specs to match markdown-it newline behaviour
- update data-generator HTML to match markdown-it newline behaviour
- fix Post "converts html to plaintext" test
- update rss spec to match markdown-it newline behaviour
- close almost all related showdown bugs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost
Projects
None yet
6 participants