public function testEmbeddedFormattedNote() { $html_text = new Html_Text(""); $html_text->newParagraph(); $html_text->addText("text"); $html_text->addNote("𐌰", "f"); $html_text->openTextStyle(array('marker' => "add"), true, false); $html_text->addNoteText("add"); $html_text->openTextStyle(array('marker' => "nd"), true, true); $html_text->addNoteText("nd"); $html_text->closeTextStyle(true, false); $html_text->addNoteText("normal"); $html_text->addText("."); $html = $html_text->getInnerHtml(); $standard = <<<'EOD' <p><span>text</span><a href="#note1" id="citation1" class="superscript">𐌰</a><span>.</span></p> <div><p class="f"><a href="#citation1" id="note1">𐌰</a><span> </span><span class="add">add</span><span class="add nd">nd</span><span>normal</span></p></div> EOD; $this->assertEquals(trim($standard), trim($html)); }
/** * This produces and saves the Fallout document. * $path: Path to the document. */ public function produceFalloutDocument($path) { $fallout = new Html_Text(Locale_Translate::_("Fallout")); $fallout->newHeading1(Locale_Translate::_("Fallout")); foreach ($this->fallout as $line) { $fallout->newParagraph(); $fallout->addText($line); } $fallout->save($path); }
// Copy font to the output directory. $font = $database_config_bible->getTextFont($bible); if ($font) { if (Fonts_Logic::fontExists($font)) { $fontpath = Fonts_Logic::getFontPath($font); copy($fontpath, "{$directory}/{$font}"); } } $backLinkPath = Export_Logic::webBackLinkDirectory($bible); $bibleBookText = $bible . " " . $database_books->getEnglishFromId($book); // Web index file for the book. $html_text_rich_book_index = new Html_Text($bibleBookText); $htmlHeader = new Html_Header($html_text_rich_book_index); $htmlHeader->searchBackLink($backLinkPath . Filter_Paths::htmlFileNameBible("", $book), Locale_Translate::_("Go back to") . " " . $bibleBookText); $htmlHeader->create(array(array($bible, Filter_Paths::htmlFileNameBible()), array($database_books->getEnglishFromId($book), Filter_Paths::htmlFileNameBible()))); $html_text_rich_book_index->newParagraph("navigationbar"); $html_text_rich_book_index->addText("|"); // Go through the chapters of this book. $chapters = $database_bibles->getChapters($bible, $book); foreach ($chapters as $chapter) { // The text filter for this chapter. $filter_text_chapter = new Filter_Text($bible); $usfm = $database_bibles->getChapter($bible, $book, $chapter); $usfm = trim($usfm); // Use small chunks of USFM at a time for much better performance. $filter_text_chapter->addUsfmCode($usfm); // Interlinked web data for one chapter. $filter_text_chapter->html_text_linked = new Html_Text(Locale_Translate::_("Bible")); $filter_text_chapter->html_text_linked->customClass = Filter_CustomCSS::getClass($bible); // Create breadcrumbs for the chapter. $htmlHeader = new Html_Header($filter_text_chapter->html_text_linked);