mindmapdoc 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dda1cd58973971d612a1df037f87776949117b260ff3289a8ae43d640239dc8a
4
- data.tar.gz: 645d5bb5171c978cc3b06ac1dc6af307f555df210023cc4d0a31b1a3d297d2c1
3
+ metadata.gz: 920c96abd91d1608b9054e896ebc762b91ab2ad3f8a291334af3ac86cb26725c
4
+ data.tar.gz: 57d3b2ac17193339e7520b4ba28d571eb0193b0e5cf27c91554ff30dfff9c1b2
5
5
  SHA512:
6
- metadata.gz: dbb0d67084e4a088e33142260e0e428248d139182e7fa8e918d17747904f0824910d6aed4ea8ee6c001022b02037b1c8d5b98c97158f3c8f5c85333bd35de187
7
- data.tar.gz: 55d03c7bed148f86f8e8a53d48f278e6bfee9f8ff07a3934e23061cb351cede25b45f013cfe3695e1128d3a33ec968de99915256a22e712bd8f00f005821a985
6
+ metadata.gz: 25a141124db90529c041ef64a58b1102dbe197ebc8d819246b0bac719b375bb5cb6fa451524c8f43acc5c813c7675eae5dd34ffe7e6e85f5d88a3b3ef62a6887
7
+ data.tar.gz: 0af97e180e0f0dff0ce9eda5bb61a2fd65de79a6e57254a968b785f902937236a43eeacce4d36b17824f522566642598acbb405862236e3784c64ad402dcc71b
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -7,7 +7,6 @@ require 'c32'
7
7
  require 'kramdown'
8
8
  require 'mindmapviz'
9
9
 
10
-
11
10
  class MindmapDoc
12
11
  using ColouredText
13
12
  include RXFHelperModule
@@ -116,6 +115,8 @@ class MindmapDoc
116
115
  @html
117
116
  end
118
117
 
118
+ # used for finding and parsing mindmapdoc blocks within a Markdown document
119
+ #
119
120
  def to_mindmapdoc(s)
120
121
 
121
122
  s2 = s.split(/(?=^--?mm-+)/).map do |raw_s|
@@ -234,12 +235,14 @@ overflow-y: auto; height: 70vh; "
234
235
  .gsub(/\b'\b/,"{::nomarkdown}'{:/}")).to_html
235
236
 
236
237
  lines = md.scan(/#[^\n]+\n/)\
237
- .map {|x| (' ' * (x.scan(/#/).length - 1)) + x[/(?<=# ).*/]}
238
- #@root = lines.first if lines.first
239
- @root = if lines.first[/^[^#\s]/] then
240
- lines.shift.chomp
241
- elsif @root.nil?
242
- 'root'
238
+ .map {|x| (' ' * (x.scan(/#/).length - 1)) + x[/(?<=# ).*/].lstrip}
239
+
240
+ if @root.nil? then
241
+ @root = if lines.first[/^[^#\s]/] then
242
+ lines.shift.chomp
243
+ else
244
+ 'root'
245
+ end
243
246
  end
244
247
 
245
248
  puts ('lines: ' + lines.inspect).debug if @debug
@@ -255,6 +258,12 @@ overflow-y: auto; height: 70vh; "
255
258
 
256
259
  lines = s.gsub(/\r/,'').strip.lines
257
260
 
261
+ if @root.nil? and s[/^\w[^\n]+\n\n/] then
262
+ @root = lines.shift
263
+ lines.shift
264
+ end
265
+
266
+
258
267
  if @root.nil? and lines.grep(/^\w/).length == 1 then
259
268
  @root = lines.shift
260
269
  lines.map! {|x| x[2..-1]}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindmapdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  B6lHIpiAVH9Sx621FqXBHf0fkcUSiXCWW1BpBLGqPsRAcA19KUIPOOn9D011To8+
36
36
  kf4RzXeKdszyRSi+lsn0EdIK
37
37
  -----END CERTIFICATE-----
38
- date: 2019-06-16 00:00:00.000000000 Z
38
+ date: 2019-06-24 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: c32
metadata.gz.sig CHANGED
Binary file