From bc4733c4cfacf74e5d7847c25fc4c2bb49e361d6 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Mon, 20 Jun 2016 21:10:33 +0100 Subject: [PATCH] Show full old style sources - inlcudes markdown --- app/Functions/FunctionsPrintFacts.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index 7e6d9695afc..46d9d254e1c 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -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 .= '
' . I18N::translate('Source') . ': ' . Filter::formatText($source, $WT_TREE) . '
'; } } - // -- 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++) {