mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-28 18:29:50 +01:00
fix: regression caused by cc6fd49c4d
This commit is contained in:
@@ -88,16 +88,9 @@ module.exports = function (Posts) {
|
||||
while (current !== null) {
|
||||
if (current[1]) {
|
||||
try {
|
||||
parsed = new URL(current[1]);
|
||||
if (!parsed.protocol) {
|
||||
if (current[1].startsWith('/')) {
|
||||
// Internal link
|
||||
absolute = nconf.get('base_url') + current[1];
|
||||
} else {
|
||||
// External link
|
||||
absolute = `//${current[1]}`;
|
||||
}
|
||||
|
||||
parsed = new URL(current[1], nconf.get('url'));
|
||||
absolute = parsed.toString();
|
||||
if (absolute !== current[1]) {
|
||||
const offset = current[0].indexOf(current[1]);
|
||||
content = content.slice(0, current.index + offset) +
|
||||
absolute +
|
||||
|
||||
Reference in New Issue
Block a user