reverse_adoc 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/README.adoc +4 -294
- data/Rakefile +2 -13
- data/reverse_adoc.gemspec +2 -20
- metadata +5 -246
- data/.editorconfig +0 -15
- data/.github/workflows/rake.yml +0 -15
- data/.gitignore +0 -10
- data/.hound.yml +0 -5
- data/.rubocop.yml +0 -10
- data/LICENSE.txt +0 -25
- data/exe/reverse_adoc +0 -70
- data/exe/w2a +0 -72
- data/lib/reverse_adoc/cleaner.rb +0 -113
- data/lib/reverse_adoc/config.rb +0 -54
- data/lib/reverse_adoc/converters/a.rb +0 -42
- data/lib/reverse_adoc/converters/aside.rb +0 -16
- data/lib/reverse_adoc/converters/audio.rb +0 -29
- data/lib/reverse_adoc/converters/base.rb +0 -100
- data/lib/reverse_adoc/converters/blockquote.rb +0 -27
- data/lib/reverse_adoc/converters/br.rb +0 -15
- data/lib/reverse_adoc/converters/bypass.rb +0 -81
- data/lib/reverse_adoc/converters/code.rb +0 -56
- data/lib/reverse_adoc/converters/div.rb +0 -18
- data/lib/reverse_adoc/converters/drop.rb +0 -22
- data/lib/reverse_adoc/converters/em.rb +0 -55
- data/lib/reverse_adoc/converters/figure.rb +0 -25
- data/lib/reverse_adoc/converters/h.rb +0 -42
- data/lib/reverse_adoc/converters/head.rb +0 -23
- data/lib/reverse_adoc/converters/hr.rb +0 -15
- data/lib/reverse_adoc/converters/ignore.rb +0 -16
- data/lib/reverse_adoc/converters/img.rb +0 -93
- data/lib/reverse_adoc/converters/li.rb +0 -17
- data/lib/reverse_adoc/converters/mark.rb +0 -21
- data/lib/reverse_adoc/converters/math.rb +0 -31
- data/lib/reverse_adoc/converters/ol.rb +0 -64
- data/lib/reverse_adoc/converters/p.rb +0 -23
- data/lib/reverse_adoc/converters/pass_through.rb +0 -13
- data/lib/reverse_adoc/converters/pre.rb +0 -55
- data/lib/reverse_adoc/converters/q.rb +0 -16
- data/lib/reverse_adoc/converters/strong.rb +0 -52
- data/lib/reverse_adoc/converters/sub.rb +0 -16
- data/lib/reverse_adoc/converters/sup.rb +0 -16
- data/lib/reverse_adoc/converters/table.rb +0 -69
- data/lib/reverse_adoc/converters/td.rb +0 -83
- data/lib/reverse_adoc/converters/text.rb +0 -65
- data/lib/reverse_adoc/converters/th.rb +0 -14
- data/lib/reverse_adoc/converters/tr.rb +0 -22
- data/lib/reverse_adoc/converters/video.rb +0 -29
- data/lib/reverse_adoc/converters.rb +0 -32
- data/lib/reverse_adoc/errors.rb +0 -10
- data/lib/reverse_adoc/html_converter.rb +0 -61
- data/lib/reverse_adoc/version.rb +0 -3
- data/lib/reverse_adoc.rb +0 -27
- data/spec/assets/anchors.html +0 -30
- data/spec/assets/basic.html +0 -61
- data/spec/assets/code.html +0 -22
- data/spec/assets/escapables.html +0 -17
- data/spec/assets/external_images.docx +0 -0
- data/spec/assets/external_images.html +0 -35
- data/spec/assets/from_the_wild.html +0 -23
- data/spec/assets/full_example.html +0 -49
- data/spec/assets/html_fragment.html +0 -3
- data/spec/assets/lists.html +0 -137
- data/spec/assets/minimum.html +0 -4
- data/spec/assets/paragraphs.html +0 -24
- data/spec/assets/quotation.html +0 -12
- data/spec/assets/tables.html +0 -99
- data/spec/assets/unknown_tags.html +0 -9
- data/spec/bin/reverse_adoc_spec.rb +0 -33
- data/spec/bin/w2a_spec.rb +0 -35
- data/spec/components/anchors_spec.rb +0 -32
- data/spec/components/basic_spec.rb +0 -63
- data/spec/components/code_spec.rb +0 -25
- data/spec/components/escapables_spec.rb +0 -30
- data/spec/components/from_the_wild_spec.rb +0 -15
- data/spec/components/html_fragment_spec.rb +0 -9
- data/spec/components/lists_spec.rb +0 -90
- data/spec/components/paragraphs_spec.rb +0 -14
- data/spec/components/quotation_spec.rb +0 -12
- data/spec/components/tables_spec.rb +0 -42
- data/spec/components/unknown_tags_spec.rb +0 -41
- data/spec/lib/reverse_adoc/cleaner_spec.rb +0 -180
- data/spec/lib/reverse_adoc/config_spec.rb +0 -25
- data/spec/lib/reverse_adoc/converters/aside_spec.rb +0 -11
- data/spec/lib/reverse_adoc/converters/audio_spec.rb +0 -15
- data/spec/lib/reverse_adoc/converters/blockquote_spec.rb +0 -23
- data/spec/lib/reverse_adoc/converters/br_spec.rb +0 -9
- data/spec/lib/reverse_adoc/converters/code_spec.rb +0 -15
- data/spec/lib/reverse_adoc/converters/div_spec.rb +0 -15
- data/spec/lib/reverse_adoc/converters/figure_spec.rb +0 -10
- data/spec/lib/reverse_adoc/converters/img_spec.rb +0 -25
- data/spec/lib/reverse_adoc/converters/li_spec.rb +0 -11
- data/spec/lib/reverse_adoc/converters/mark_spec.rb +0 -10
- data/spec/lib/reverse_adoc/converters/p_spec.rb +0 -10
- data/spec/lib/reverse_adoc/converters/pre_spec.rb +0 -43
- data/spec/lib/reverse_adoc/converters/q_spec.rb +0 -10
- data/spec/lib/reverse_adoc/converters/strong_spec.rb +0 -21
- data/spec/lib/reverse_adoc/converters/text_spec.rb +0 -67
- data/spec/lib/reverse_adoc/converters/video_spec.rb +0 -15
- data/spec/lib/reverse_adoc/converters_spec.rb +0 -22
- data/spec/lib/reverse_adoc.rb +0 -90
- data/spec/spec_helper.rb +0 -25
- data/spec/support/shell_helpers.rb +0 -15
@@ -1,16 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
class Sup < Base
|
4
|
-
def to_coradoc(node, state = {})
|
5
|
-
content = treat_children(node, state)
|
6
|
-
Coradoc::Element::Inline::Superscript.new(content)
|
7
|
-
end
|
8
|
-
|
9
|
-
def convert(node, state = {})
|
10
|
-
Coradoc::Generator.gen_adoc(to_coradoc(node, state))
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
register :sup, Sup.new
|
15
|
-
end
|
16
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
class Table < Base
|
4
|
-
def to_coradoc(node, state = {})
|
5
|
-
id = node["id"]
|
6
|
-
title = extract_title(node)
|
7
|
-
attrs = style(node)
|
8
|
-
content = treat_children_coradoc(node, state)
|
9
|
-
Coradoc::Element::Table.new(title, content, { id: id, attrs: attrs })
|
10
|
-
end
|
11
|
-
|
12
|
-
def convert(node, state = {})
|
13
|
-
Coradoc::Generator.gen_adoc(to_coradoc(node, state))
|
14
|
-
end
|
15
|
-
|
16
|
-
def extract_title(node)
|
17
|
-
title = node.at("./caption")
|
18
|
-
return "" if title.nil?
|
19
|
-
|
20
|
-
treat_children(title, {})
|
21
|
-
end
|
22
|
-
|
23
|
-
def frame(node)
|
24
|
-
case node["frame"]
|
25
|
-
when "void"
|
26
|
-
"none"
|
27
|
-
when "hsides"
|
28
|
-
"topbot"
|
29
|
-
when "vsides"
|
30
|
-
"sides"
|
31
|
-
when "box", "border"
|
32
|
-
"all"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def rules(node)
|
37
|
-
case node["rules"]
|
38
|
-
when "all"
|
39
|
-
"all"
|
40
|
-
when "rows"
|
41
|
-
"rows"
|
42
|
-
when "cols"
|
43
|
-
"cols"
|
44
|
-
when "none"
|
45
|
-
"none"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def style(node)
|
50
|
-
attrs = Coradoc::Element::AttributeList.new
|
51
|
-
# Width is disabled on tables for now. (From #88)
|
52
|
-
# attrs.add_named("width", node["width"]) if node["width"]
|
53
|
-
|
54
|
-
frame_attr = frame(node)
|
55
|
-
attrs.add_named("frame", frame_attr) if frame_attr
|
56
|
-
|
57
|
-
rules_attr = rules(node)
|
58
|
-
attrs.add_named("rules", rules_attr) if rules_attr
|
59
|
-
|
60
|
-
# This line should be removed.
|
61
|
-
return "" if attrs.empty?
|
62
|
-
|
63
|
-
attrs
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
register :table, Table.new
|
68
|
-
end
|
69
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
class Td < Base
|
4
|
-
def to_coradoc(node, state = {})
|
5
|
-
# convert(node, state)
|
6
|
-
id = node["id"]
|
7
|
-
colrowattr = colrow(node["colspan"], node["rowspan"])
|
8
|
-
alignattr = alignstyle(node)
|
9
|
-
style = cellstyle(node)
|
10
|
-
|
11
|
-
singlepara = node.elements.size == 1 && node.elements.first.name == "p"
|
12
|
-
state[:tdsinglepara] = singlepara if singlepara
|
13
|
-
|
14
|
-
adoccell = node.at(".//ul | .//ol | .//pre | .//blockquote | .//br | .//hr") ||
|
15
|
-
node.at(".//p") && !singlepara
|
16
|
-
|
17
|
-
style = "a" if adoccell
|
18
|
-
delim = adoccell ? "\n" : " "
|
19
|
-
content = treat_children_coradoc(node, state)
|
20
|
-
options = {}.tap do |hash|
|
21
|
-
hash[:id] = id
|
22
|
-
hash[:colrowattr] = colrowattr
|
23
|
-
hash[:alignattr] = alignattr
|
24
|
-
hash[:style] = style
|
25
|
-
hash[:content] = content
|
26
|
-
hash[:delim] = delim
|
27
|
-
end
|
28
|
-
|
29
|
-
Coradoc::Element::Table::Cell.new(options)
|
30
|
-
end
|
31
|
-
|
32
|
-
def convert(node, state = {})
|
33
|
-
Coradoc::Generator.gen_adoc(to_coradoc(node, state))
|
34
|
-
end
|
35
|
-
|
36
|
-
def cellstyle(_node)
|
37
|
-
""
|
38
|
-
end
|
39
|
-
|
40
|
-
def colrow(colspan, rowspan)
|
41
|
-
if colspan && rowspan && colspan != "1" && rowspan != "1"
|
42
|
-
"#{colspan}.#{rowspan}+"
|
43
|
-
elsif colspan && colspan != "1"
|
44
|
-
"#{colspan}+"
|
45
|
-
elsif rowspan && rowspan != "1"
|
46
|
-
".#{rowspan}+"
|
47
|
-
else
|
48
|
-
""
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def alignstyle(node)
|
53
|
-
align = node["align"]
|
54
|
-
valign = node["valign"]
|
55
|
-
a = case align
|
56
|
-
when "left" then "<"
|
57
|
-
when "center" then "^"
|
58
|
-
when "right" then ">"
|
59
|
-
else
|
60
|
-
""
|
61
|
-
end
|
62
|
-
v = case valign
|
63
|
-
when "top" then "<"
|
64
|
-
when "middle" then "^"
|
65
|
-
when "bottom" then ">"
|
66
|
-
else
|
67
|
-
""
|
68
|
-
end
|
69
|
-
if align && valign
|
70
|
-
"#{a}.#{v}"
|
71
|
-
elsif align
|
72
|
-
a
|
73
|
-
elsif valign
|
74
|
-
".#{v}"
|
75
|
-
else
|
76
|
-
""
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
register :td, Td.new
|
82
|
-
end
|
83
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
class Text < Base
|
4
|
-
def to_coradoc(node, state = {})
|
5
|
-
return treat_empty(node, state) if node.text.strip.empty?
|
6
|
-
|
7
|
-
Coradoc::Element::TextElement.new(treat_text(node))
|
8
|
-
end
|
9
|
-
|
10
|
-
def convert(node, state = {})
|
11
|
-
Coradoc::Generator.gen_adoc(to_coradoc(node, state))
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def treat_empty(node, state)
|
17
|
-
parent = node.parent.name.to_sym
|
18
|
-
if %i[ol ul].include?(parent) # Otherwise the identation is broken
|
19
|
-
""
|
20
|
-
elsif state[:tdsinglepara]
|
21
|
-
""
|
22
|
-
elsif node.text == " " # Regular whitespace text node
|
23
|
-
" "
|
24
|
-
else
|
25
|
-
""
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def treat_text(node)
|
30
|
-
text = node.text
|
31
|
-
text = preserve_nbsp(text)
|
32
|
-
text = remove_border_newlines(text)
|
33
|
-
text = remove_inner_newlines(text)
|
34
|
-
text = escape_keychars(text)
|
35
|
-
|
36
|
-
text = preserve_keychars_within_backticks(text)
|
37
|
-
escape_links(text)
|
38
|
-
end
|
39
|
-
|
40
|
-
def preserve_nbsp(text)
|
41
|
-
text.gsub(/\u00A0/, " ")
|
42
|
-
end
|
43
|
-
|
44
|
-
def escape_links(text)
|
45
|
-
text.gsub(/<<([^>]*)>>/, "\\<<\\1>>")
|
46
|
-
end
|
47
|
-
|
48
|
-
def remove_border_newlines(text)
|
49
|
-
text.gsub(/\A\n+/, "").gsub(/\n+\z/, "")
|
50
|
-
end
|
51
|
-
|
52
|
-
def remove_inner_newlines(text)
|
53
|
-
text.tr("\n\t", " ").squeeze(" ")
|
54
|
-
end
|
55
|
-
|
56
|
-
def preserve_keychars_within_backticks(text)
|
57
|
-
text.gsub(/`.*?`/) do |match|
|
58
|
-
match.gsub('\_', "_").gsub('\*', "*")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
register :text, Text.new
|
64
|
-
end
|
65
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
class Tr < Base
|
4
|
-
def to_coradoc(node, state = {})
|
5
|
-
content = treat_children_coradoc(node, state)
|
6
|
-
header = table_header_row?(node)
|
7
|
-
Coradoc::Element::Table::Row.new(content, header)
|
8
|
-
end
|
9
|
-
|
10
|
-
def convert(node, state = {})
|
11
|
-
Coradoc::Generator.gen_adoc(to_coradoc(node, state))
|
12
|
-
end
|
13
|
-
|
14
|
-
def table_header_row?(node)
|
15
|
-
# node.element_children.all? {|child| child.name.to_sym == :th}
|
16
|
-
node.previous_element.nil?
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
register :tr, Tr.new
|
21
|
-
end
|
22
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
class Video < Base
|
4
|
-
def to_coradoc(node, _state = {})
|
5
|
-
src = node["src"]
|
6
|
-
id = node["id"]
|
7
|
-
title = extract_title(node)
|
8
|
-
attributes = Coradoc::Element::AttributeList.new
|
9
|
-
options = options(node)
|
10
|
-
attributes.add_named("options", options) if options.any?
|
11
|
-
Coradoc::Element::Video.new(title, id: id, src: src,
|
12
|
-
attributes: attributes)
|
13
|
-
end
|
14
|
-
|
15
|
-
def convert(node, state = {})
|
16
|
-
Coradoc::Generator.gen_adoc(to_coradoc(node, state))
|
17
|
-
end
|
18
|
-
|
19
|
-
def options(node)
|
20
|
-
autoplay = node["autoplay"]
|
21
|
-
loop_attr = node["loop"]
|
22
|
-
controls = node["controls"]
|
23
|
-
[autoplay, loop_attr, controls].compact
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
register :video, Video.new
|
28
|
-
end
|
29
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module ReverseAdoc
|
2
|
-
module Converters
|
3
|
-
def self.register(tag_name, converter)
|
4
|
-
@@converters ||= {}
|
5
|
-
@@converters[tag_name.to_sym] = converter
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.unregister(tag_name)
|
9
|
-
@@converters.delete(tag_name.to_sym)
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.lookup(tag_name)
|
13
|
-
@@converters[tag_name.to_sym] or default_converter(tag_name)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.default_converter(tag_name)
|
17
|
-
case ReverseAdoc.config.unknown_tags.to_sym
|
18
|
-
when :pass_through
|
19
|
-
ReverseAdoc::Converters::PassThrough.new
|
20
|
-
when :drop
|
21
|
-
ReverseAdoc::Converters::Drop.new
|
22
|
-
when :bypass
|
23
|
-
ReverseAdoc::Converters::Bypass.new
|
24
|
-
when :raise
|
25
|
-
raise UnknownTagError, "unknown tag: #{tag_name}"
|
26
|
-
else
|
27
|
-
raise InvalidConfigurationError,
|
28
|
-
"unknown value #{ReverseAdoc.config.unknown_tags.inspect} for ReverseAdoc.config.unknown_tags"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
data/lib/reverse_adoc/errors.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "converters/a"
|
4
|
-
require_relative "converters/aside"
|
5
|
-
require_relative "converters/audio"
|
6
|
-
require_relative "converters/blockquote"
|
7
|
-
require_relative "converters/br"
|
8
|
-
require_relative "converters/bypass"
|
9
|
-
require_relative "converters/code"
|
10
|
-
require_relative "converters/div"
|
11
|
-
require_relative "converters/drop"
|
12
|
-
require_relative "converters/em"
|
13
|
-
require_relative "converters/figure"
|
14
|
-
require_relative "converters/h"
|
15
|
-
require_relative "converters/head"
|
16
|
-
require_relative "converters/hr"
|
17
|
-
require_relative "converters/ignore"
|
18
|
-
require_relative "converters/img"
|
19
|
-
require_relative "converters/mark"
|
20
|
-
require_relative "converters/li"
|
21
|
-
require_relative "converters/ol"
|
22
|
-
require_relative "converters/p"
|
23
|
-
require_relative "converters/pass_through"
|
24
|
-
require_relative "converters/pre"
|
25
|
-
require_relative "converters/q"
|
26
|
-
require_relative "converters/strong"
|
27
|
-
require_relative "converters/sup"
|
28
|
-
require_relative "converters/sub"
|
29
|
-
require_relative "converters/table"
|
30
|
-
require_relative "converters/td"
|
31
|
-
require_relative "converters/th"
|
32
|
-
require_relative "converters/text"
|
33
|
-
require_relative "converters/tr"
|
34
|
-
require_relative "converters/video"
|
35
|
-
require_relative "converters/math"
|
36
|
-
|
37
|
-
module ReverseAdoc
|
38
|
-
class HtmlConverter
|
39
|
-
def self.to_coradoc(input, options = {})
|
40
|
-
root = case input
|
41
|
-
when String
|
42
|
-
Nokogiri::HTML(input).root
|
43
|
-
when Nokogiri::XML::Document
|
44
|
-
input.root
|
45
|
-
when Nokogiri::XML::Node
|
46
|
-
input
|
47
|
-
end
|
48
|
-
|
49
|
-
return "" unless root
|
50
|
-
|
51
|
-
ReverseAdoc.config.with(options) do
|
52
|
-
ReverseAdoc::Converters.lookup(root.name).to_coradoc(root)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.convert(input, options = {})
|
57
|
-
result = Coradoc::Generator.gen_adoc(to_coradoc(input, options))
|
58
|
-
ReverseAdoc.cleaner.tidy(result)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
data/lib/reverse_adoc/version.rb
DELETED
data/lib/reverse_adoc.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "digest"
|
4
|
-
require "nokogiri"
|
5
|
-
require_relative "reverse_adoc/version"
|
6
|
-
require_relative "reverse_adoc/errors"
|
7
|
-
require_relative "reverse_adoc/cleaner"
|
8
|
-
require_relative "reverse_adoc/config"
|
9
|
-
require_relative "reverse_adoc/converters"
|
10
|
-
require_relative "reverse_adoc/converters/base"
|
11
|
-
require_relative "reverse_adoc/html_converter"
|
12
|
-
|
13
|
-
module ReverseAdoc
|
14
|
-
def self.convert(input, options = {})
|
15
|
-
ReverseAdoc::HtmlConverter.convert(input, options)
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.config
|
19
|
-
@config ||= Config.new
|
20
|
-
yield @config if block_given?
|
21
|
-
@config
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.cleaner
|
25
|
-
@cleaner ||= Cleaner.new
|
26
|
-
end
|
27
|
-
end
|
data/spec/assets/anchors.html
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<body>
|
3
|
-
some text...
|
4
|
-
<a href="http://foobar.com">Foobar</a>
|
5
|
-
<a href="http://foobar.com" title="f***** up beyond all recognition">Fubar</a>
|
6
|
-
<a href="http://foobar.com" title="f***** up beyond all redemption"/>
|
7
|
-
<a href="http://strong.foobar.com"><strong>Strong foobar</strong></a>
|
8
|
-
There should be space before but not after the anchor (<a href="http://foobar.com">stripped</a>).
|
9
|
-
|
10
|
-
do not ignore <a href="foo.html"> </a> anchor tags with no link text
|
11
|
-
link <a href="#content">internal jumplinks</a> with anchors
|
12
|
-
link <a href="#content2"/>internal jumplinks without anchors
|
13
|
-
treat <a id="content">anchor tags with no href</a> as bookmarks
|
14
|
-
|
15
|
-
some text...
|
16
|
-
|
17
|
-
<a href="#a__b spaced">Double __ anchor with space</a>
|
18
|
-
|
19
|
-
Double __ anchor with space <a id="a__b spaced"/>
|
20
|
-
|
21
|
-
<a id="_Toc12345"/>
|
22
|
-
|
23
|
-
<img src="http://foobar.com/logo.png">
|
24
|
-
<img alt="foobar image" src="http://foobar.com/foobar.png">
|
25
|
-
<img alt="foobar image 2" title="this is the foobar image 2" src="http://foobar.com/foobar2.png">
|
26
|
-
some text...
|
27
|
-
|
28
|
-
<h1><a id="a__Foreword"></a>Text</h1>
|
29
|
-
</body>
|
30
|
-
</html>
|
data/spec/assets/basic.html
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<body>
|
3
|
-
plain text
|
4
|
-
<h1>h1</h1>
|
5
|
-
<h1 id="A">h1 with anchor</h1>
|
6
|
-
<h2>h2</h2>
|
7
|
-
<h3>h3</h3>
|
8
|
-
<h4>h4</h4>
|
9
|
-
<h5>h5</h5>
|
10
|
-
<h6>h6</h6>
|
11
|
-
|
12
|
-
<em>em tag content</em>
|
13
|
-
before <em></em> and after empty em tags
|
14
|
-
before <em> </em> and after em tags containing whitespace
|
15
|
-
before <em> <em> <br /> </em> </em> and after em tags containing whitespace
|
16
|
-
<em><em>double em tags</em></em>
|
17
|
-
<p><em><em>double em tags in p tag</em></em></p>
|
18
|
-
a<em> em with leading and trailing </em>whitespace
|
19
|
-
a<em>
|
20
|
-
em with extra leading and trailing
|
21
|
-
</em>whitespace
|
22
|
-
|
23
|
-
<strong>strong tag content</strong>
|
24
|
-
before <strong></strong> and after empty strong tags
|
25
|
-
before <strong> </strong> and after strong tags containing whitespace
|
26
|
-
before <strong> <strong> <br /> </strong> </strong> and after strong tags containing whitespace
|
27
|
-
<strong><strong>double strong tags</strong></strong>
|
28
|
-
<p><strong><strong>double strong tags in p tag</strong></strong></p>
|
29
|
-
before
|
30
|
-
<strong>
|
31
|
-
<strong>
|
32
|
-
double strong tags containing whitespace
|
33
|
-
</strong>
|
34
|
-
</strong> after
|
35
|
-
a<strong> strong with leading and trailing </strong>whitespace
|
36
|
-
a<strong>
|
37
|
-
strong with extra leading and trailing
|
38
|
-
</strong>whitespace
|
39
|
-
|
40
|
-
constrai<strong>ned</strong> strong
|
41
|
-
constrai<i>ned</i> italic
|
42
|
-
|
43
|
-
<b>b tag content</b>
|
44
|
-
<i>i tag content</i>
|
45
|
-
|
46
|
-
H<sub>2</sub>O
|
47
|
-
A<sup>2</sup>B
|
48
|
-
|
49
|
-
br tags become double space followed by newline<br/>
|
50
|
-
|
51
|
-
before hr
|
52
|
-
<hr/>
|
53
|
-
after hr
|
54
|
-
|
55
|
-
<div>section 1</div>
|
56
|
-
<div>section 2</div>
|
57
|
-
|
58
|
-
ignore <abbr>abbr</abbr>
|
59
|
-
|
60
|
-
</body>
|
61
|
-
</html>
|
data/spec/assets/code.html
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<body>
|
3
|
-
<pre>pre block</pre>
|
4
|
-
<code>code block</code>
|
5
|
-
<pre><code>pre code block</code></pre>
|
6
|
-
|
7
|
-
<p>Paragraph with inline <code>code</code> block</p>
|
8
|
-
|
9
|
-
<pre><code>var this;
|
10
|
-
this.is("A multi line code block")
|
11
|
-
console.log("Yup, it is")
|
12
|
-
</code></pre>
|
13
|
-
|
14
|
-
Code with indentation:
|
15
|
-
<pre><code>tell application "Foo"
|
16
|
-
beep
|
17
|
-
end tell
|
18
|
-
</code></pre>
|
19
|
-
|
20
|
-
</body>
|
21
|
-
</html>
|
22
|
-
|
data/spec/assets/escapables.html
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<body>
|
3
|
-
some text...
|
4
|
-
|
5
|
-
**two asterisks**
|
6
|
-
***three asterisks***
|
7
|
-
***three *and*the* asterisc*word and asterisc**multword asterisks***
|
8
|
-
__two underscores__
|
9
|
-
___three underscores___
|
10
|
-
___three__underscores___ and another_undersocre
|
11
|
-
|
12
|
-
some text...
|
13
|
-
|
14
|
-
<pre><code>var theoretical_max_infin = 1.0;</code></pre>
|
15
|
-
|
16
|
-
</body>
|
17
|
-
</html>
|
Binary file
|
@@ -1,35 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
|
2
|
-
<?xml version="1.0" encoding="UTF-8"??><html xmlns="http://www.w3.org/1999/xhtml" style="margin: 0;">
|
3
|
-
<!--This file was converted to xhtml by LibreOffice - see http://cgit.freedesktop.org/libreoffice/core/tree/filter/source/xslt for the code.--><head profile="http://dublincore.org/documents/dcmi-terms/">
|
4
|
-
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8">
|
5
|
-
<meta name="DCTERMS.title" content="" xml:lang="en-US">
|
6
|
-
<meta name="DCTERMS.language" content="en-US" scheme="DCTERMS.RFC4646">
|
7
|
-
<meta name="DCTERMS.source" content="http://xml.openoffice.org/odf2xhtml">
|
8
|
-
<meta name="DCTERMS.creator" content="Nick Nicholas">
|
9
|
-
<meta name="DCTERMS.issued" content="2019-11-21T08:48:00" scheme="DCTERMS.W3CDTF">
|
10
|
-
<meta name="DCTERMS.contributor" content="Nick Nicholas">
|
11
|
-
<meta name="DCTERMS.modified" content="2019-11-21T10:01:00" scheme="DCTERMS.W3CDTF">
|
12
|
-
<meta name="DCTERMS.provenance" content="" xml:lang="en-US">
|
13
|
-
<meta name="DCTERMS.subject" content="," xml:lang="en-US">
|
14
|
-
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en">
|
15
|
-
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en">
|
16
|
-
<link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en">
|
17
|
-
<link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en">
|
18
|
-
</head>
|
19
|
-
<body dir="ltr" style="max-width: 21.001cm; margin: 2.54cm 3.175cm;">
|
20
|
-
<h1 class="P3" style="clear: both; color: #2f5496; font-size: 16pt; font-family: Calibri Light; writing-mode: lr-tb; margin: 0.423cm 0 0cm;" align="left ! important">
|
21
|
-
<a id="a__Hello" style="margin: 0;"><span style="margin: 0;"></span></a><span class="T1" style="margin: 0;">Hello</span>
|
22
|
-
</h1>
|
23
|
-
<p class="P1" style="font-size: 12pt; font-family: Calibri; writing-mode: lr-tb; margin: 0;" align="left ! important"> </p>
|
24
|
-
<p class="Standard" style="font-size: 12pt; font-family: Calibri; writing-mode: lr-tb; margin: 0;" align="left ! important"><span class="T1" style="margin: 0;">H</span><h1 class="T3" style="vertical-align: super; font-size: 58%; margin: 0;">2</h1><span class="T1" style="margin: 0;">0</span></p>
|
25
|
-
<p class="P1" style="font-size: 12pt; font-family: Calibri; writing-mode: lr-tb; margin: 0;" align="left ! important"> </p>
|
26
|
-
<!--Next 'div' was a 'text:p'.--><div class="Standard" style="font-size: 12pt; font-family: Calibri; writing-mode: lr-tb; margin: 0;" align="left ! important">
|
27
|
-
<!--Next ' span' is a draw:frame. --><span style="margin: 0;"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" style="margin: 0;"><mrow style="margin: 0;"><mrow style="margin: 0;"><mrow style="margin: 0;"></mrow><mrow style="margin: 0;"><mi style="margin: 0;">i</mi><mo stretchy="false" style="margin: 0;">=</mo><mn style="margin: 0;">1</mn></mrow></mrow><mrow style="margin: 0;"><mrow style="margin: 0;"></mrow><mi style="margin: 0;">n</mi><msubsup style="margin: 0;"><mi style="margin: 0;">β</mi><mn style="margin: 0;">2</mn><mi style="margin: 0;">i</mi></msubsup></mrow></mrow></math></span>
|
28
|
-
</div>
|
29
|
-
<div style="clear: both; line-height: 0; width: 0; height: 0; margin: 0; padding: 0;"> </div>
|
30
|
-
<!--Next 'div' was a 'text:p'.--><div class="Standard" style="font-size: 12pt; font-family: Calibri; writing-mode: lr-tb; margin: 0;" align="left ! important">
|
31
|
-
<a id="_GoBack" style="margin: 0;"></a><!--Next ' span' is a draw:frame. --><span style="height: 1.764cm; margin: 0cm; padding: 0; border: none; width: 1.764cm; font-size: 12pt; font-family: Calibri; text-align: center; vertical-align: top; background-color: transparent;" class="fr1" id="Εικόνα_2"><img style="height: 1.764cm; width: 1.764cm; margin: 0;" alt="" src="data:image/gif;base64,R0lGODlhZABkAIAAAAAAAP///ywAAAAAZABkAEAC+4yPqcvtD6OctNqLs968XwCGokd24kidYckuKri9cFvKQCzTdG7x+u+y+YDECqqIzByTzKbzCY1Kp9Sq9eoQKrTY1Ev57TJsuLA4Meylz8HTxMz2LOPFOR1ov+v3/L7/DxgoOEj4IcRVeLA2Bue3CEHGF2nYyDaJcWn5+LZ5lamm0tf5MHpWilYJ6INymmiQ52q0EqsBSythews5qwt60wscLDxMXGx8jJysvMzc7PwM7XmYWzh9SPuJmuq43Raq2ooQbpUdMT5Vbn4ela7+fdfu/h4Xv9stfS/vBr+uPa+Zz94/gPvADCRY0FdCfgdxBezSr1+Vh+Iaclu4KoSiKGsSL9YTRu1YSGMji5UkdnJYSpC8nq0M9hJYzF4zo9m8iTOnzigFAAAh/tNUaGlzIGZpbGUgd2FzIGNyZWF0ZWQgYnkNDUdyYXBoaWMgV29ya3Nob3CZIFByb2Zlc3Npb25hbCAyLjBhDQ1mcm9tIEFsY2hlbXkgTWluZHdvcmtzIEluYy4NaHR0cDovL3d3dy5taW5kd29ya3Nob3AuY29tDQ1UaGlzIGltYWdlIG1heSBoYXZlIGJlZW4gY3JlYXRlZCBieQ1hIHBhcnR5IG90aGVyIHRoYW4gQWxjaGVteSBNaW5kd29ya3MgSW5jLg0NVXNlIG5vIGhvb2tzADs="></span>
|
32
|
-
</div>
|
33
|
-
<div style="clear: both; line-height: 0; width: 0; height: 0; margin: 0; padding: 0;"> </div>
|
34
|
-
</body>
|
35
|
-
</html>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<p>
|
2
|
-
<strong>
|
3
|
-
<strong>
|
4
|
-
.<br />
|
5
|
-
</strong>
|
6
|
-
*** intentcast
|
7
|
-
</strong>
|
8
|
-
: logo design
|
9
|
-
<strong>
|
10
|
-
<strong>
|
11
|
-
<br />
|
12
|
-
</strong>
|
13
|
-
</strong>
|
14
|
-
<strong>
|
15
|
-
<strong>
|
16
|
-
.
|
17
|
-
</strong>
|
18
|
-
</strong>
|
19
|
-
</p>
|
20
|
-
|
21
|
-
<a href="example.com/foo_bar">
|
22
|
-
<img src="example.com/foo_bar.png"> I\_AM\_HELPFUL
|
23
|
-
</a>
|