---- En mar, 29 jun 2021 21:33:19 +0200 Michał Marcin Brzuchalski 
<michal.brzuchal...@gmail.com> escribió ----
 > Hi Manuel,
 > I think a Markdown document including PHP code snippet with above examples
 > could cause issues while parsing.
 > I can imagine parsers don't expect end-of-snippet tag "```" being not an
 > end tag actually.
 > 
 > Cheers,
 > Michał Marcin Brzuchalski
 

Hi, Michal,

You can escape backticks using a different number of backticks as a wrapper. 
Examples:

1.

``There is a literal backtick (`) here.``

We're using two backstick as wrapper of one backtick.

2. Using Rowan example:


````php
$markdown=```
PHP has lots of ways to write strings:  
```
$example = 'hello';  
$example = "hello";  
$example = <<<EXAMPLE  
hello  
EXAMPLE;  
$example = <<<EXAMPLE  
hello  
EXAMPLE;  
```
```
````

Live example: https://github.com/manuelcanga/RFC/blob/master/README.md

This works due to use four backticks as wrapper of three backticks.

Although these examples work generally, with some Markdown  parser can that  
these doesn't work.

Maybe other syntax could be used, but I don't know which. In javascript only a 
backtick is used: 
https://developers.google.com/web/updates/2015/01/ES6-Template-Strings . But in 
PHP this is used as eval.


Regards,
Manuel Canga

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to