Skip to content

Commit

Permalink
Show full old style sources - inlcudes markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Jun 20, 2016
1 parent f647039 commit bc4733c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/Functions/FunctionsPrintFacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,18 @@ public static function printFactSources($factrec, $level) {
$data = '';
$nlevel = $level + 1;

// -- Systems not using source records [ 1046971 ]
// -- The old style is not supported when entering sources, but if found in the GEDCOM then display them fully
// -- Also, the old style sources allow histo.* files to use tree independent source citations, which
// -- will display nicely when markdown is used
$ct = preg_match_all("/$level SOUR (.*)/", $factrec, $match, PREG_SET_ORDER);
// Systems not using source records
// The old style is not supported when entering or editing sources, but may be found in imported trees.
// Also, the old style sources allow histo.* files to use tree independent source citations, which
// will display nicely when markdown is used.
$ct = preg_match_all('/' . $level . ' SOUR (.*)((?:\n\d CONT.*)*)/', $factrec, $match, PREG_SET_ORDER);
for ($j = 0; $j < $ct; $j++) {
if (strpos($match[$j][1], '@') === false) {
$source = Filter::escapeHtml($match[$j][1]) . Filter::escapeHtml(Functions::getCont(3, Functions::getSubRecord(2, "2 SOUR", $factrec, $j+1)));
$source = Filter::escapeHtml($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2]));
$data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $WT_TREE) . '</span></div>';
}
}
// -- find source for each fact
// Find source for each fact
$ct = preg_match_all("/$level SOUR @(.*)@/", $factrec, $match, PREG_SET_ORDER);
$spos2 = 0;
for ($j = 0; $j < $ct; $j++) {
Expand Down

0 comments on commit bc4733c

Please sign in to comment.