mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
Added better greentext function to parsedown
Greentext and redtext meme arrows now show using css.
This commit is contained in:
parent
ce615c1b5b
commit
aed892a5f8
2 changed files with 56 additions and 22 deletions
26
theme/bulma/css/bulma.min.css
vendored
26
theme/bulma/css/bulma.min.css
vendored
|
@ -1,4 +1,28 @@
|
||||||
.btn1 {
|
greentext:before {
|
||||||
|
content:">";
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
redtext:before {
|
||||||
|
content:"<";
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
purpletext:before {
|
||||||
|
content:"@";
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.content greentext {
|
||||||
|
color: #789922;
|
||||||
|
content: ">";
|
||||||
|
}
|
||||||
|
|
||||||
|
.content redtext {
|
||||||
|
color: #d12222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content purpletext {
|
||||||
|
color: #9f14ae;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
|
|
52
vendor/erusev/parsedown/Parsedown.php
vendored
52
vendor/erusev/parsedown/Parsedown.php
vendored
|
@ -121,14 +121,15 @@ class Parsedown
|
||||||
'8' => array('List'),
|
'8' => array('List'),
|
||||||
'9' => array('List'),
|
'9' => array('List'),
|
||||||
':' => array('Table'),
|
':' => array('Table'),
|
||||||
'<' => array('Comment', 'Markup'),
|
'<' => array('Comment', 'Markup','Redtext'),
|
||||||
'=' => array('SetextHeader'),
|
'=' => array('SetextHeader'),
|
||||||
'>' => array('Quote'),
|
'>' => array('Greentext'),
|
||||||
'[' => array('Reference'),
|
'[' => array('Reference'),
|
||||||
'_' => array('Rule'),
|
'_' => array('Rule'),
|
||||||
'`' => array('FencedCode'),
|
'`' => array('FencedCode'),
|
||||||
'|' => array('Table'),
|
'|' => array('Table'),
|
||||||
'~' => array('FencedCode'),
|
'~' => array('FencedCode'),
|
||||||
|
'@' => array('Purpletext'),
|
||||||
);
|
);
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
@ -652,13 +653,13 @@ class Parsedown
|
||||||
#
|
#
|
||||||
# Quote
|
# Quote
|
||||||
|
|
||||||
protected function blockQuote($Line)
|
protected function blockGreentext($Line)
|
||||||
{
|
{
|
||||||
if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
|
if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
|
||||||
{
|
{
|
||||||
$Block = array(
|
$Block = array(
|
||||||
'element' => array(
|
'element' => array(
|
||||||
'name' => 'blockquote',
|
'name' => 'greentext',
|
||||||
'handler' => 'lines',
|
'handler' => 'lines',
|
||||||
'text' => (array) $matches[1],
|
'text' => (array) $matches[1],
|
||||||
),
|
),
|
||||||
|
@ -668,30 +669,39 @@ class Parsedown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function blockQuoteContinue($Line, array $Block)
|
protected function blockRedtext($Line)
|
||||||
{
|
{
|
||||||
if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches))
|
if (preg_match('/^<[ ]?(.*)/', $Line['text'], $matches))
|
||||||
{
|
{
|
||||||
if (isset($Block['interrupted']))
|
$Block = array(
|
||||||
{
|
'element' => array(
|
||||||
$Block['element']['text'] []= '';
|
'name' => 'Redtext',
|
||||||
|
'handler' => 'lines',
|
||||||
unset($Block['interrupted']);
|
'text' => (array) $matches[1],
|
||||||
}
|
),
|
||||||
|
);
|
||||||
$Block['element']['text'] []= $matches[1];
|
|
||||||
|
|
||||||
return $Block;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! isset($Block['interrupted']))
|
|
||||||
{
|
|
||||||
$Block['element']['text'] []= $Line['text'];
|
|
||||||
|
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function blockPurpletext($Line)
|
||||||
|
{
|
||||||
|
if (preg_match('/^@[ ]?(.*)/', $Line['text'], $matches))
|
||||||
|
{
|
||||||
|
$Block = array(
|
||||||
|
'element' => array(
|
||||||
|
'name' => 'purpletext',
|
||||||
|
'handler' => 'lines',
|
||||||
|
'text' => (array) $matches[1],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return $Block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Rule
|
# Rule
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue