diff --git a/lib/isodoc/xref.rb b/lib/isodoc/xref.rb index 9e7eabed..506e752c 100644 --- a/lib/isodoc/xref.rb +++ b/lib/isodoc/xref.rb @@ -18,25 +18,31 @@ class Xref # Note: if bibrender is no passed in, do not parse references def initialize(lang, script, klass, i18n, options = {}) - @anchors = {} + initialize_empty @lang = lang @script = script @klass = klass @options = options - @i18n = i18n - @labels = @i18n.get - @klass.i18n = @i18n + initialize_i18n(i18n) @klass.bibrender ||= options[:bibrender] - @locale = options[:locale] @reqt_models = @klass.requirements_processor - .new({ - default: "default", lang:, script:, - labels: @i18n.get - }) - @i18n + .new({ default: "default", lang:, script:, + labels: @i18n.get }) + end + + def initialize_empty + @c = HTMLEntities.new + @anchors = {} @parse_settings = {} end + def initialize_i18n(i18n) + @i18n = i18n + @labels = @i18n.get + @klass.i18n = @i18n + @locale = @options[:locale] + end + def get @anchors end