Giter Site home page Giter Site logo

Email links support about parsedown HOT 7 CLOSED

erusev avatar erusev commented on May 8, 2024
Email links support

from parsedown.

Comments (7)

erusev avatar erusev commented on May 8, 2024

Email link support is coming in version 0.2.0.

from parsedown.

hkdobrev avatar hkdobrev commented on May 8, 2024

Great! You could create a milestone :)

BTW, here is a failing test for email: https://github.com/hkdobrev/parsedown/commit/2c21118d806d0e07651e788201211b3185876acc

from parsedown.

hkdobrev avatar hkdobrev commented on May 8, 2024

What's up with this one?

from parsedown.

scottchiefbaker avatar scottchiefbaker commented on May 8, 2024

Any progress on this? Seems simple, and it is part of the original markdown syntax.

from parsedown.

hkdobrev avatar hkdobrev commented on May 8, 2024

@erusev Great! Perhaps you should mention Parsedown does not support obfuscation in the readme or something. It could be useful for systems which rely on this feature and consider changing their Markdown parser.

from parsedown.

jenstornell avatar jenstornell commented on May 8, 2024

@hkdobrev

For someone who wants obfuscated emails, quick and dirty:

Add this somewhere outside the class.

function getObfuscatedEmailLink($email) {
    $out = '';
    for($i=0; $i < strlen($email); $i++){
        $out .= "&#" . ord($email[$i]) . ";";
    }
    return $out;
}

In the element function put this:

if($name == 'href') {
  $markup .= " $name=\"".$value.'"';
} else {
  $markup .= " $name=\"".self::escape($value).'"';
}

In the inlineEmailTag put this:

$url = getObfuscatedEmailLink($url);
$url = "mailto:$url";

from parsedown.

janstieler avatar janstieler commented on May 8, 2024

@jenstornell
can you more explain on which lines I have to put the code in?
And is there also a way to do it for md files? I mean if i don't use markdown inline.

Cheers

from parsedown.

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.