lib/govspeak.rb in govspeak-0.8.15 vs lib/govspeak.rb in govspeak-0.8.16
- old
+ new
@@ -1,23 +1,28 @@
require 'kramdown'
require 'govspeak/header_extractor'
+require 'kramdown/parser/kramdown_with_automatic_external_links'
require 'htmlentities'
module Govspeak
class Document
+ Parser = Kramdown::Parser::KramdownWithAutomaticExternalLinks
+ PARSER_CLASS_NAME = Parser.name.split("::").last
+
@@extensions = []
attr_accessor :images
def self.to_html(source, options = {})
new(source, options).to_html
end
def initialize(source, options = {})
@source = source ? source.dup : ""
- @options = options.merge(entity_output: :symbolic)
+ Parser.document_domains = options.delete(:document_domains)
+ @options = {input: PARSER_CLASS_NAME, entity_output: :symbolic}.merge(options)
@images = []
super()
end
def kramdown_doc