def sub_inline_anchors(text, found = nil)
if @context == :list_item && @parent.style == 'bibliography'
text = text.sub(InlineBiblioAnchorRx) {
Inline.new(self, :anchor, %([#{$2 || $1}]), :type => :bibref, :id => $1, :target => $1).convert
}
end
if ((!found || found[:square_bracket]) && text.include?('[[')) ||
((!found || found[:macroish]) && text.include?('or:'))
text = text.gsub(InlineAnchorRx) {
next $&.slice 1, $&.length if $1
if (id = $2)
reftext = $3
else
id = $4
if (reftext = $5) && (reftext.include? R_SB)
reftext = reftext.gsub ESC_R_SB, R_SB
end
end
Inline.new(self, :anchor, reftext, :type => :ref, :id => id, :target => id).convert
}
end
text
end