Prevents attributes, HTML escape applied on links
When the link come without label: => gemini://thesite.gmi The A markup would be: <a href="gemini://thesite.gmi">gemini:<i>thesite.gmi</a></i>
This commit is contained in:
parent
28ddc04ba2
commit
1900f3c03b
|
@ -116,12 +116,14 @@ foreach ($fileLines as $line) {
|
||||||
preg_match("/^=>\s*([^\s]+)\s*(.*)$/", $line, $linkParts);
|
preg_match("/^=>\s*([^\s]+)\s*(.*)$/", $line, $linkParts);
|
||||||
$url_link = $linkParts[1];
|
$url_link = $linkParts[1];
|
||||||
$url_label = $linkParts[2];
|
$url_label = $linkParts[2];
|
||||||
if (empty($url_label)) $url_label = $url_link;
|
if (empty($url_label)) {
|
||||||
htmlEscape($url_link);
|
$url_label = $url_link;
|
||||||
keepSpaces($url_link);
|
} else {
|
||||||
|
// the label is humain-made, apply formatting
|
||||||
htmlEscape($url_label);
|
htmlEscape($url_label);
|
||||||
keepSpaces($url_label);
|
keepSpaces($url_label);
|
||||||
if ($mode_textAttributes) addTextAttributes($url_label);
|
if ($mode_textAttributes) addTextAttributes($url_label);
|
||||||
|
}
|
||||||
print("<p><a href='".$url_link."'>".$url_label."</a></p>\n");
|
print("<p><a href='".$url_link."'>".$url_label."</a></p>\n");
|
||||||
} elseif ('"""' == $line3) {
|
} elseif ('"""' == $line3) {
|
||||||
$mode_textAttributes = !$mode_textAttributes;
|
$mode_textAttributes = !$mode_textAttributes;
|
||||||
|
|
Loading…
Reference in New Issue