Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
BSD-3-CLAUSE License
Bot releases are hidden (Show)
Published by colinodell over 8 years ago
Converter
as a function (#233, #239)advanceBySpaceOrTab
convenience method to Cursor
Cursor
(#234)Published by colinodell over 8 years ago
EmphasisParser::parse()
to simplify it (#223)Published by colinodell almost 9 years ago
Environment
parameter to CommonMarkConverter
constructorHeader
=> Heading
ATXHeaderParser
=> ATXHeadingParser
SetExtHeaderParser
=> SetExtHeadingParser
HeaderRenderer
=> HeadingRenderer
HorizontalRule
=> ThematicBreak
HorizontalRuleParser
=> ThematicBreakParser
HorizontalRuleRenderer
=> ThematicBreakRenderer
HorizontalRuleRendererTest
=> ThematicBreakRendererTest
RegexHelper::getHRuleRegex()
=> RegexHelper::getThematicBreakRegex()
Html
=> HtmlInline
RawHtmlParser
=> HtmlInlineParser
RawHtmlRenderer
=> HtmlInlineRenderer
<>
Heading
constructor now allows $contents
to be a string
(old behavior) or string[]
(new)Published by colinodell almost 9 years ago
safe
option to true
AbstractBlock::finalize()
now reqires a second parameter, $endLineNumber
RegexHelper::REGEX_ENTITY
no longer includes the starting /
or the ending /i
(#194)Node::setParent()
now accepts null values (#203)endLine
positions (#187)DocParser::preProcessInput
dropping up to 2 ending newlines instead of just oneEntityParser
not checking for ampersands at the start of the current position (#192, #194)bin/commonmark
for Windows due to PHP issues (#189, #195)Published by colinodell about 9 years ago
Published by colinodell about 9 years ago
Published by colinodell about 9 years ago
Published by colinodell about 9 years ago
This release contains several major internal changes. It will likely break compatibility with custom elements, parsers, and renderers. Simple Markdown parsing is unaffected.
Node
class, which both AbstractBlock
and AbstractInline
extend from (#169)NodeWalker
and NodeWalkerEvent
to traverse the AST without using recursionInlineContainer
interface for blocksgetContainer()
and getReferenceMap()
methods to InlineParserContext
iframe
to whitelist of HTML block tags (as per spec)./bin/commonmark
for converting Markdown at the command lineAbstractBlock
and AbstractInline
both extend from Node
isContainer()
methodAbstractBlock
:
getParent()
is now parent()
setParent()
now expects a Node
instead of an AbstractBlock
getChildren()
is now children()
getLastChild()
is now lastChild()
addChild()
is now appendChild()
InlineParserContext
is constructed using the container AbstractBlock
and the document's RefereceMap
Cursor
using the container's string contentsInlineParserEngine::parse
now requires the Node
container and the document's ReferenceMap
instead of a ContextInterface
and Cursor
Delimiter
to reference the actual inline Node
instead of the position
int $pos
protected member and constructor arg is now Node $node
getInlineNode()
and setInlineNode()
instead of getPos()
and setPos()
DocParser::processInlines
to use a NodeWalker
to iterate through inlines
AbstractBlock
while
loop instead of recursion to traverse the ASTImage
and Link
now only accept a string as their second argumentCloseBracketParser::parse()
works internallyCloseBracketParser::createInline
no longer accepts label inlinesAbstractBlock::setLastLineBlank()
AbstractBlock::shouldLastLineBeBlank()
and new DocParser::setAndPropagateLastLineBlank()
methodAbstractBlock::setLastLineBlank()
is now a setter method for AbstractBlock::$lastLineBlank
AbstractBlock::handleRemainingContents()
is no longer abstract
DocParser
checked the wrong method to determine remainder handling behaviorHorizontalRuleParser
failed to advance the cursor beyond the parsed horizontal rule charactersDocParser
not ignoring the final newline of the input (like the reference parser does)Block\Element\AbstractInlineContainer
AbstractBlock
and implement InlineContainer
insteadgetInlines
and setInlines
AbstractBlock::replaceChild()
Node::replaceWith()
directly the child node insteadgetInlines()
method from InlineParserContext
$inlineContext->getContainer()->appendChild()
instead of $inlineContext->getInlines()->add()
ContextInterface
argument from AbstractInlineParser::parse()
and InlineParserEngine::parseCharacter
ArrayCollection $inlines
argument from InlineProcessorInterface::processInlines()
CloseBracketParser::nullify()
pre
from rule 6 of HTML blocks (see jgm/CommonMark#355)Published by colinodell about 9 years ago
HtmlRendererInterface
with ElementRendererInterface
(#141)trim()
and string cast from ListItemRenderer
Published by colinodell over 9 years ago
isIndented
helper method to Cursor
Converter
base class which CommonMarkConverter
extends from (#105)ListBlock::$data
and ListItem::$data
to $listData
IndentedCodeParser::CODE_INDENT_LEVEL
to Cursor::INDENT_LEVEL
Published by colinodell over 9 years ago
Published by colinodell over 9 years ago
Published by colinodell over 9 years ago
ReferenceMap
via listReferences()
(#73)Published by colinodell over 9 years ago
Now with 50% more speed!
Published by colinodell over 9 years ago
Published by colinodell almost 10 years ago
'0'
(#55)Published by colinodell almost 10 years ago
Published by colinodell almost 10 years ago