fix markdown

This commit is contained in:
Dennis Eichhorn 2023-11-10 14:46:56 +00:00
parent 0c9921b737
commit 5c38b8b250
6 changed files with 12 additions and 25 deletions

View File

@ -448,19 +448,17 @@ class Markdown
// Keystrokes // Keystrokes
if ($this->options['keystrokes'] ?? true) { if ($this->options['keystrokes'] ?? true) {
$this->inlineTypes['['][] = 'Keystrokes'; $this->inlineTypes['['][] = 'Keystrokes';
$this->inlineMarkerList .= '[';
} }
// Spoiler // Spoiler
if ($this->options['spoiler'] ?? false) { if ($this->options['spoiler'] ?? false) {
$this->inlineTypes['>'][] = 'Spoiler'; $this->inlineTypes['>'][] = 'Spoiler';
$this->inlineMarkerList .= '='; $this->inlineMarkerList .= '>';
} }
// Inline Math // Inline Math
if ($this->options['math'] ?? false) { if ($this->options['math'] ?? false) {
$this->inlineTypes['\\'][] = 'Math'; $this->inlineTypes['\\'][] = 'Math';
$this->inlineMarkerList .= '\\';
$this->inlineTypes['$'][] = 'Math'; $this->inlineTypes['$'][] = 'Math';
$this->inlineMarkerList .= '$'; $this->inlineMarkerList .= '$';
} }
@ -479,7 +477,6 @@ class Markdown
// Emojis // Emojis
if ($this->options['emojis'] ?? true) { if ($this->options['emojis'] ?? true) {
$this->inlineTypes[':'][] = 'Emojis'; $this->inlineTypes[':'][] = 'Emojis';
$this->inlineMarkerList .= ':';
} }
// Typographer // Typographer
@ -491,7 +488,6 @@ class Markdown
$this->inlineTypes['+'][] = 'Typographer'; $this->inlineTypes['+'][] = 'Typographer';
$this->inlineMarkerList .= '+'; $this->inlineMarkerList .= '+';
$this->inlineTypes['!'][] = 'Typographer'; $this->inlineTypes['!'][] = 'Typographer';
$this->inlineMarkerList .= '!';
$this->inlineTypes['?'][] = 'Typographer'; $this->inlineTypes['?'][] = 'Typographer';
$this->inlineMarkerList .= '?'; $this->inlineMarkerList .= '?';
} }
@ -515,25 +511,21 @@ class Markdown
// Embeding // Embeding
if ($this->options['embeding'] ?? false) { if ($this->options['embeding'] ?? false) {
$this->inlineTypes['['][] = 'Embeding'; $this->inlineTypes['['][] = 'Embeding';
$this->inlineMarkerList .= '[';
} }
// Map // Map
if ($this->options['map'] ?? false) { if ($this->options['map'] ?? false) {
$this->inlineTypes['['][] = 'Map'; $this->inlineTypes['['][] = 'Map';
$this->inlineMarkerList .= '[';
} }
// Address // Address
if ($this->options['address'] ?? false) { if ($this->options['address'] ?? false) {
$this->inlineTypes['['][] = 'Address'; $this->inlineTypes['['][] = 'Address';
$this->inlineMarkerList .= '[';
} }
// Contact // Contact
if ($this->options['contact'] ?? false) { if ($this->options['contact'] ?? false) {
$this->inlineTypes['['][] = 'Contact'; $this->inlineTypes['['][] = 'Contact';
$this->inlineMarkerList .= '[';
} }
} }
@ -1493,7 +1485,7 @@ class Markdown
protected function inlineContact(array $excerpt) : ?array protected function inlineContact(array $excerpt) : ?array
{ {
if (!($this->options['contact'] ?? false) if (!($this->options['contact'] ?? false)
|| (\preg_match('/\[contact.*?([a-zA-Z]+)="([a-zA-Z0-9\-_]+)"\]/', $excerpt['text'], $matches) !== 1) || (\preg_match('/\[contact.*?([a-zA-Z]+)="(.*?)"\]/', $excerpt['text'], $matches) !== 1)
) { ) {
return null; return null;
} }
@ -2749,7 +2741,7 @@ class Markdown
while ($rowNo + $rowspan < $rowCount while ($rowNo + $rowspan < $rowCount
&& $index < \count($rows[$rowNo + $rowspan]['elements']) && $index < \count($rows[$rowNo + $rowspan]['elements'])
&& $rows[$rowNo + $rowspan]['elements'][$index]['handler']['argument'] === '^' && $rows[$rowNo + $rowspan]['elements'][$index]['handler']['argument'] === '^'
&& (isset($element['attributes']['colspan']) && $element['attributes']['colspan'] ?? null) === ($rows[$rowNo + $rowspan]['elements'][$index]['attributes']['colspan'] ?? null) && ($element['attributes']['colspan'] ?? null) === ($rows[$rowNo + $rowspan]['elements'][$index]['attributes']['colspan'] ?? null)
) { ) {
$rows[$rowNo + $rowspan]['elements'][$index]['merged'] = true; $rows[$rowNo + $rowspan]['elements'][$index]['merged'] = true;
++$rowspan; ++$rowspan;

View File

@ -1,9 +0,0 @@
[contact phone="+49 123 456 789"]
[contact facebook="@jinggaApp"]
[contact discord="jingga"]
[contact email="test@email.com"]
[contact twitter="@jinggaApp"]
[contact youtube="@jinggaApp"]
[contact instagram="jinggaApp"]
[contact slack="jinggaApp"]
[contact teams="jinggaApp"]

View File

@ -1,2 +1,5 @@
<p>[video src="<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;ab_channel=RickAstley">https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;ab_channel=RickAstley</a>"]</p> <p><iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allow="autoplay" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-forms">https://www.youtube.com/watch?v=dQw4w9WgXcQ&amp;ab_channel=RickAstley</iframe>
<video src="test.mp4"></video> <iframe src="https://player.vimeo.com/video/874474957" frameborder="0" allow="autoplay" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-forms">https://vimeo.com/874474957</iframe>
<iframe src="https://www.dailymotion.com/video/x3w7rss" frameborder="0" allow="autoplay" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-forms">https://www.dailymotion.com/video/x3w7rss</iframe>
<video src="test.mp4" controls="">test.mp4</video>
<audio src="test.mp3" controls="">test.mp3</audio></p>

View File

@ -1,4 +1,5 @@
[video src="https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley"] [video src="https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley"]
[video src="https://vimeo.com/874474957"] [video src="https://vimeo.com/874474957"]
[video src="https://www.dailymotion.com/video/x3w7rss"] [video src="https://www.dailymotion.com/video/x3w7rss"]
[video src="test.mp4"] [video src="test.mp4"]
[audio src="test.mp3"]

View File

@ -1 +1 @@
<div id="" class="map" data-lat="1.0" data-lon="1.0"></div> <p><div id="-" class="map" data-lat="1.0" data-lon="1.0"></div></p>

View File

@ -1 +1 @@
&copy; <p>&copy;</p>