TriviaMD 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trivia_md.rb +1 -1
- data/lib/trivia_parser.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c9d294431e5bbcee588459e604abd0a7c92d2215ef5299c6b67fcee87975ef8
|
4
|
+
data.tar.gz: 4ea3c51bc2d91522aa2654606a08821e0289a732ffb67edac6c046d32367687e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd57a640a346fba946b62fc02fd5d9a50c8c92189b93e5e28ab5c7b354dc141f9afa396ead8ceaca01e011d2deaa35228a5831e7dd5c318bac4a8e4b856a9bed
|
7
|
+
data.tar.gz: b72de6ecb4fd805f2d035fbc263ec41a46cf6de0e89c03d3a034b39735a03cea801ff48279f1b6dcbd67936475b3685402413e21a2c869dbd68d527231632916
|
data/lib/trivia_md.rb
CHANGED
data/lib/trivia_parser.rb
CHANGED
@@ -2,8 +2,9 @@ require 'kramdown'
|
|
2
2
|
|
3
3
|
class TriviaParser
|
4
4
|
include Kramdown::Utils::Html
|
5
|
-
def initialize(
|
6
|
-
@
|
5
|
+
def initialize(file_path, debug = false)
|
6
|
+
@file_path = file_path
|
7
|
+
@file = File.read(@file_path)
|
7
8
|
@debug = debug
|
8
9
|
end
|
9
10
|
|
@@ -17,9 +18,14 @@ class TriviaParser
|
|
17
18
|
return { type: :no_event }
|
18
19
|
end
|
19
20
|
|
21
|
+
|
22
|
+
def markdown_gitlies_url
|
23
|
+
"#{ENV.fetch('GITLIES_PROJECT_URL', 'https://gitlies.com/')}#{@file_path}"
|
24
|
+
end
|
25
|
+
|
20
26
|
def parse_reason(c)
|
21
27
|
if c.options[:lang] == "html"
|
22
|
-
c.value.strip
|
28
|
+
c.value.strip.gsub(/{GITLIES_MD}/,markdown_gitlies_url)
|
23
29
|
else
|
24
30
|
escape_html(c.value.strip)
|
25
31
|
end
|