function testDoesNotParseAHeader() { $element = new T_Text_Header(4, '**content**'); $element->accept(new T_Text_EmphLexer()); $expected = new T_Text_Header(4, '**content**'); $this->assertEquals($expected, $element); }
function testParsesAHeader() { $element = new T_Text_Header(4, '^2'); $element->accept(new T_Text_SuperSubscriptLexer()); $expected = new T_Text_Header(4, null); $expected->addChild(new T_Text_Superscript('2')); $this->assertEquals($expected, $element); }
/** * Close header tag. * * @param T_Text_Paragraph $node */ function postTextHeader(T_Text_Header $node) { $level = $node->getLevel() + $this->header_shift; if ($level > 6) { $this->xhtml .= '</strong></p>'; } else { $this->xhtml .= "</h{$level}>"; } }
function testParsesAHeader() { $element = new T_Text_Header(4, '[http://example.com content]'); $element->accept(new T_Text_LinkLexer()); $expected = new T_Text_Header(4, null); $expected->addChild(new T_Text_ExternalLink('content', 'http://example.com')); $this->assertEquals($expected, $element); }
function testLeavesHeaderContentAlone() { $text = T_Text_List::UNORDERED . ' Item #1'; $header = new T_Text_Header(3, $text); $expect = clone $header; $header->accept(new T_Text_ListLexer()); $this->assertEquals($expect, $header); }
function testThatHeaderChildrenRemainUnaffected() { $element = new T_Text_Header(2, "title"); $element->addChild(new T_Text_Plain('some text')); $expect = new T_Text_Header(2, "title"); $expect->addChild(new T_Text_Plain('some text')); $element->accept(new T_Text_ParagraphLexer()); $this->assertEquals($expect, $element); }