|
5 mesiacov pred | |
---|---|---|
app | 5 mesiacov pred | |
config | 5 mesiacov pred | |
data | 6 mesiacov pred | |
extend | 3 rokov pred | |
public | 6 mesiacov pred | |
route | 6 mesiacov pred | |
runtime | 3 rokov pred | |
temp | 10 mesiacov pred | |
vendor | 6 mesiacov pred | |
view | 5 mesiacov pred | |
.example.env | 3 rokov pred | |
.gitignore | 6 mesiacov pred | |
.travis.yml | 3 rokov pred | |
LICENSE | 3 rokov pred | |
LICENSE.txt | 3 rokov pred | |
README.md | 3 rokov pred | |
composer.json | 5 mesiacov pred | |
composer.lock | 5 mesiacov pred | |
think | 3 rokov pred |
thinkphp6 个人博客
修改 UEditor.all.js 配置
me.commands['insertcode'] = {
execCommand : function(cmd,lang){
// ... 省略
if(pre){
pre.className = lang; /*'brush:'+lang+';toolbar:false;';*/
}else{
// ... 省略
me.execCommand('inserthtml','<pre id="coder" class="'+lang+'">'+code+'</pre>',true);
// ... 省略
}
},
// ... 省略
};
修改 Parsedown.php
24 行
function text($text)
{
// ... 省略
}
// ===> 改为
function text($text)
{
$Elements = $this->textElements($text);
# convert to markup
$markup = $this->elements($Elements);
# trim line breaks
$markup = trim($markup, "\n");
return $markup;
}
protected function textElements($text)
{
# make sure no definitions are set
$this->DefinitionData = array();
# standardize line breaks
$text = str_replace(array("\r\n", "\r"), "\n", $text);
# remove surrounding line breaks
$text = trim($text, "\n");
# split text into lines
$lines = explode("\n", $text);
# iterate through lines to identify blocks
return $this->linesElements($lines);
}
blockHeader 修改
protected function blockHeader($Line)
{
$level = strspn($Line['text'], '#');
if ($level > 6)
{
return;
}
$text = trim($Line['text'], '#');
if ($this->strictMode and isset($text[0]) and $text[0] !== ' ')
{
return;
}
$text = trim($text, ' ');
$Block = array(
'element' => array(
'name' => 'h' . $level,
'handler' => array(
'function' => 'lineElements',
'argument' => $text,
'destination' => 'elements',
)
),
);
return $Block;
}