GithubHelp home page GithubHelp logo

Comments (9)

egil avatar egil commented on July 20, 2024

This is definitely a security problem that needs fixing. Thanks for pointing this out. Cheers, Egil.

from php-markdown-extra-extended.

ziz avatar ziz commented on July 20, 2024

This appears to be related to an inconvenient overlap between the Markdown Extra and Markdown Extended parsers and backtick-fenced code blocks versus backtick-enclosed code spans. We've made a change (crowdfavorite/php-markdown-extra-extended@92612c0) that I believe addresses the behavior properly in Extended mode while leaving the Extra mode parsing untouched, and I cannot at this time speak to the proper behavior of Extra in similar situations.

from php-markdown-extra-extended.

metude avatar metude commented on July 20, 2024

I think issue still remains. If render below in Markdown Extended parser it returns empty.

In DOM above code comes with comment line;

<!--?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
?-->

from php-markdown-extra-extended.

clphillips avatar clphillips commented on July 20, 2024

This is definitely still an issue.

from php-markdown-extra-extended.

egil avatar egil commented on July 20, 2024

I do not have any free time to contribute to this project the foreseeable future. If anybody can contribute a fix I will be happy to merge it into the project.

from php-markdown-extra-extended.

nazar-pc avatar nazar-pc commented on July 20, 2024

This bug is solved in my fork: PHP Markdown Next
Actually, solution is simple:
in _hashHTMLBlocks_inMarkdown method, "Check for: Code span marker", replace

$tag[0] == '`'

by

$tag[0] == '`' && $tag[1] !== '`'

from php-markdown-extra-extended.

clphillips avatar clphillips commented on July 20, 2024

@nazar-pc With your fix, instead of:

<pre><code class="language-php">&lt;?php
echo "hello world";
?&gt;
</code></pre>

I get:

<pre><code class="language-php"><!--?php
echo "hello world";
?-->
</code></pre>

Looks like unwarranted comment blocks, as @metude pointed out, is still an issue.

from php-markdown-extra-extended.

nazar-pc avatar nazar-pc commented on July 20, 2024

Sorry, looks like I have another realization of doFencedCodeBlocks method.
Try my parser, it doesn't differ much from this one, but works correctly and a little bit faster.
If you need this parser - look at doFencedCodeBlocks method from my fork for the solution.

from php-markdown-extra-extended.

clphillips avatar clphillips commented on July 20, 2024

Thanks @nazar-pc will checkout your fork.

from php-markdown-extra-extended.

Related Issues (7)

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.