Skip to content

Commit

Permalink
PW link target for Chr. (Boehtlingk Chrestomathie).
Browse files Browse the repository at this point in the history
  • Loading branch information
funderburkjim committed Apr 4, 2023
1 parent 18ae0d4 commit 380bfc1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion v02/makotemplates/web/webtc/basicadjust.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function ls_callback_pwg($matches) {
// 04-14-2021. Use 'gralink' for certain values of 'code'
//$linkcodes = array('ṚV.','AV.','P');
$href = $this->ls_callback_pwg_href($code,$data1);

dbgprint($dbg,"ls_callback_pwg. code=$code, data1=$data1, href=$href\n");
if ($href != null) {
// link
//$ans = "<gralink href='$href' n='$tooltip'><ls>$datanew</ls></gralink>";
Expand Down Expand Up @@ -367,6 +367,21 @@ public function ls_callback_pwg_href($code,$data) {
dbgprint($dbg,"$pfx: href=$href\n");
return $href;
}

if (preg_match('|^(Chr[.]) *([0-9]+)|',$data,$matches)) {
// Boehtlingk Chrestomathie, 2nd edition.
if (! in_array($this->dict,array('pw'))) {
// PWG refers under N. (Nalopakhyana), maybe others.
// Not yet handled.
return $href;
}
$pfx = $matches[1];
$verse = $matches[2]; // page
$href = "https://sanskrit-lexicon-scans.github.io/bchrest/index.html?$verse";
dbgprint($dbg,"$pfx: href=$href\n");
return $href;
}

if (!preg_match('|^(.*?)[.] *([0-9]+)[ ,]+([0-9]+)[ ,]+([0-9]+)(.*)$|',$data,$matches)) {
return $href;
}
Expand Down

0 comments on commit 380bfc1

Please sign in to comment.