lib/mastalk.rb in mastalk-0.2.1 vs lib/mastalk.rb in mastalk-0.3.0

- old
+ new

@@ -1,6 +1,7 @@ require 'kramdown' +require 'htmlentities' require_relative 'mastalk/extensions' module Mastalk # Document class to preprocess # mastalk specific syntax @@ -12,11 +13,11 @@ def initialize(source) @source = source.dup end def to_html - kramdown.to_html + ::HTMLEntities.new.decode( kramdown.to_html ) end private def kramdown @@ -24,10 +25,10 @@ end def preprocess(source) extensions.map do |regex, block| if source.match(regex) - source.sub!(regex, block.call(Regexp.last_match.captures.first)) + source.sub!(regex, block.call(Regexp.last_match.captures.first).strip) end end preprocess(source) if extensions.any? {|regex, _| source.match(regex)} source end