Skip to content

Commit

Permalink
Add iframe conversion support (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagandeepsinghj and [email protected] authored Oct 29, 2024
1 parent 45f35da commit 97298f9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/reverse_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
require 'reverse_markdown/converters/td'
require 'reverse_markdown/converters/text'
require 'reverse_markdown/converters/tr'
require 'reverse_markdown/converters/iframe'

module ReverseMarkdown

Expand Down
4 changes: 4 additions & 0 deletions lib/reverse_markdown/converters/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def extract_title(node)
title = escape_keychars(node['title'].to_s)
title.empty? ? '' : %[ "#{title}"]
end

def extract_src(node)
node['src'].to_s.empty? ? '' : node['src'].to_s
end
end
end
end
11 changes: 11 additions & 0 deletions lib/reverse_markdown/converters/iframe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module ReverseMarkdown
module Converters
class Iframe < Base
def convert(node, state = {})
extract_src(node)
end
end

register :iframe, Iframe.new
end
end

0 comments on commit 97298f9

Please sign in to comment.