progsource / maddy

C++ Markdown to HTML header-only parser library
MIT License
194 stars 39 forks source link

Underscores in link URL translated to <em> tag #21

Open icarroll opened 5 years ago

icarroll commented 5 years ago

Minimal Code Example

[Plastic bag code](https://en.wikivoyage.org/wiki/Common_scams#Plastic_bag_code)

<a href="https://en.wikivoyage.org/wiki/Common<em>scams#Plastic</em>bag_code">Plastic bag code</a>

Conditions

. .
Operating System: Ubuntu 18.04
Compiler: g++ 7.4.0
Compiler flags: -std=gnu++11
maddy version: 59b808bf50eadbd441d5642b4240c2ddb8d9e82f

Description

It appears that maddy formats underscores before checking to see whether the text is a URL that should not be formatted.

progsource commented 5 years ago

Hi,

thank you for your report! Sadly I'm quiet busy at work/RL, so I cannot come up with a fix directly.

I hope to get a major update in July/August done latest, so that this problem will be fixed then.

A somewhat workaround for now would be probably to use a URL shortener for URLs with underscores.

icarroll commented 5 years ago

No worries. For the time being I just disabled the <em> translation as I'm not using it.

cha-ku commented 4 years ago

Hey @progsource I'd like to work on this issue.

progsource commented 4 years ago

@cha-ku that is a nice thing :) feel free to open up a pull-request, when you're ready.

The planned major update will take me longer as planned to finish anyway ;)

progsource commented 4 years ago

Update: there is now a configuration flag to disable the emphasized parser. (Starting with version 1.1.1)