fix: fix comment link
disable auto linking of URLs in comments fix #230
This commit is contained in:
		
							parent
							
								
									e15bbeb896
								
							
						
					
					
						commit
						c9a041eee3
					
				| 
						 | 
				
			
			@ -1817,6 +1817,7 @@ function markdown_parser($incoming_comment)
 | 
			
		|||
    return $incoming_comment;
 | 
			
		||||
}
 | 
			
		||||
add_filter('preprocess_comment', 'markdown_parser');
 | 
			
		||||
remove_filter( 'comment_text', 'make_clickable', 9 );
 | 
			
		||||
 | 
			
		||||
//保存Markdown评论
 | 
			
		||||
function save_markdown_comment($comment_ID, $comment_approved)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ class Parsedown
 | 
			
		|||
{
 | 
			
		||||
    # ~
 | 
			
		||||
 | 
			
		||||
    const version = '1.7.3';
 | 
			
		||||
    const version = '1.7.4';
 | 
			
		||||
 | 
			
		||||
    # ~
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1489,7 +1489,22 @@ class Parsedown
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $permitRawHtml = false;
 | 
			
		||||
 | 
			
		||||
        if (isset($Element['text']))
 | 
			
		||||
        {
 | 
			
		||||
            $text = $Element['text'];
 | 
			
		||||
        }
 | 
			
		||||
        // very strongly consider an alternative if you're writing an
 | 
			
		||||
        // extension
 | 
			
		||||
        elseif (isset($Element['rawHtml']))
 | 
			
		||||
        {
 | 
			
		||||
            $text = $Element['rawHtml'];
 | 
			
		||||
            $allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode'];
 | 
			
		||||
            $permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (isset($text))
 | 
			
		||||
        {
 | 
			
		||||
            $markup .= '>';
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1500,11 +1515,15 @@ class Parsedown
 | 
			
		|||
 | 
			
		||||
            if (isset($Element['handler']))
 | 
			
		||||
            {
 | 
			
		||||
                $markup .= $this->{$Element['handler']}($Element['text'], $Element['nonNestables']);
 | 
			
		||||
                $markup .= $this->{$Element['handler']}($text, $Element['nonNestables']);
 | 
			
		||||
            }
 | 
			
		||||
            elseif (!$permitRawHtml)
 | 
			
		||||
            {
 | 
			
		||||
                $markup .= self::escape($text, true);
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                $markup .= self::escape($Element['text'], true);
 | 
			
		||||
                $markup .= $text;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $markup .= '</'.$Element['name'].'>';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue