asciidoctor: use absolute paths on up links

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-07-18 00:00:00 +00:00
parent 8413aeaec4
commit 7d6f4a2252

View File

@@ -11,7 +11,15 @@ class LinkTargetUp < Asciidoctor::Extensions::InlineMacroProcessor
ExternalLinkRegex = /^https?:\/\//
def target_base
'..'
# Return an absolute path here because you will
# often want your out/ to be a symlink to your hard
# disk, and doing just '..' in that case breaks.
#
# The downside is that you can't move the repo around
# and still have the HTML work, but other Buildroot things
# will likely break anyways in that case, so this is
# the least of worries.
File.expand_path('..', __dir__)
end
def process parent, target, attrs