Verified Commit 5e0ecd4f authored by Camil Staps's avatar Camil Staps 🚀

Documentation browser: fix links layout and external links

parent ff55fe36
......@@ -29,6 +29,10 @@
.Heading1Chapter img, .Newchapter img {
display: none;
}
a:visited {
color: blue !important;
}
</style>
</head>
<body>
......
......@@ -13,12 +13,16 @@ $doc->loadHTMLFile(CLEANHOME . '/doc/CleanLangRep/' . $file);
function transformLink($orgfile, $a) {
$href = $a->getAttribute('href');
$match = [];
if (preg_match('/^(.*)#(.*)$/', $href, $match) == 0)
$a->setAttribute('href', '#' . $href);
$file = $match[1] != '' ? $match[1] : $orgfile;
$hash = $match[2];
$a->setAttribute('href', '#' . $file . ';jump=' . $hash);
if (substr($href, 0, 4) == 'http') {
$a->setAttribute('target', '_blank');
} else {
$match = [];
if (preg_match('/^(.*)#(.*)$/', $href, $match) == 0)
$a->setAttribute('href', '#' . $href);
$file = $match[1] != '' ? $match[1] : $orgfile;
$hash = $match[2];
$a->setAttribute('href', '#' . $file . ';jump=' . $hash);
}
}
foreach ($doc->getElementsByTagName('a') as $a) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment