rdoc 6.14.1 → 6.14.2
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 +4 -4
- data/lib/rdoc/markdown.kpeg +44 -1
- data/lib/rdoc/markdown.rb +46 -3
- data/lib/rdoc/version.rb +1 -1
- data/rdoc.gemspec +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff34d02bfaa6b5e36bd3ab29b6fdfc10e41a50ba0fbef3841aed3e59d22e8d29
|
4
|
+
data.tar.gz: bee9f682708babef768b5fe0b5b68a505ad09ba255c20c00fdefb52cd5135566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10729c09826000d5ac6d4137fdba80b36dd7da96c66475ee03fcfe527dd159a74f41ec8c1a5cb588373c4007ea02a18cd9ca5e09e1766125daab7e84ca17a6ae
|
7
|
+
data.tar.gz: 785c69b91032d0e72810f91c56271d100d03439355bda96f808faaea60ec2768caab376a8420bbbb72e7bbeb6c50a06ed5a002c668342aa80444ee7d0b1c2a6f
|
data/lib/rdoc/markdown.kpeg
CHANGED
@@ -496,6 +496,46 @@
|
|
496
496
|
"<s>#{text}</s>"
|
497
497
|
end
|
498
498
|
end
|
499
|
+
|
500
|
+
##
|
501
|
+
# Parses inline markdown in table cells
|
502
|
+
|
503
|
+
def parse_table_cells(table)
|
504
|
+
# Parse header cells
|
505
|
+
table.header = table.header.map { |cell| parse_cell_inline(cell) }
|
506
|
+
|
507
|
+
# Parse body cells
|
508
|
+
table.body = table.body.map do |row|
|
509
|
+
row.map { |cell| parse_cell_inline(cell) }
|
510
|
+
end
|
511
|
+
|
512
|
+
table
|
513
|
+
end
|
514
|
+
|
515
|
+
##
|
516
|
+
# Parses inline markdown in a single table cell
|
517
|
+
|
518
|
+
def parse_cell_inline(text)
|
519
|
+
return text if text.nil? || text.empty?
|
520
|
+
|
521
|
+
# Create a new parser instance for the cell
|
522
|
+
cell_parser = RDoc::Markdown.new(@extensions, @debug)
|
523
|
+
|
524
|
+
# Parse the cell content
|
525
|
+
doc = cell_parser.parse(text)
|
526
|
+
|
527
|
+
# Extract the parsed content
|
528
|
+
if doc && doc.parts && !doc.parts.empty?
|
529
|
+
para = doc.parts.first
|
530
|
+
if para.is_a?(RDoc::Markup::Paragraph)
|
531
|
+
para.parts.join
|
532
|
+
else
|
533
|
+
text
|
534
|
+
end
|
535
|
+
else
|
536
|
+
text
|
537
|
+
end
|
538
|
+
end
|
499
539
|
}
|
500
540
|
|
501
541
|
root = Doc
|
@@ -1201,7 +1241,10 @@ CodeFence = &{ github? }
|
|
1201
1241
|
|
1202
1242
|
Table = &{ github? }
|
1203
1243
|
TableHead:header TableLine:line TableRow+:body
|
1204
|
-
{
|
1244
|
+
{
|
1245
|
+
table = RDoc::Markup::Table.new(header, line, body)
|
1246
|
+
parse_table_cells(table)
|
1247
|
+
}
|
1205
1248
|
|
1206
1249
|
TableHead = TableItem2+:items "|"? @Newline
|
1207
1250
|
{ items }
|
data/lib/rdoc/markdown.rb
CHANGED
@@ -882,6 +882,46 @@ class RDoc::Markdown
|
|
882
882
|
end
|
883
883
|
end
|
884
884
|
|
885
|
+
##
|
886
|
+
# Parses inline markdown in table cells
|
887
|
+
|
888
|
+
def parse_table_cells(table)
|
889
|
+
# Parse header cells
|
890
|
+
table.header = table.header.map { |cell| parse_cell_inline(cell) }
|
891
|
+
|
892
|
+
# Parse body cells
|
893
|
+
table.body = table.body.map do |row|
|
894
|
+
row.map { |cell| parse_cell_inline(cell) }
|
895
|
+
end
|
896
|
+
|
897
|
+
table
|
898
|
+
end
|
899
|
+
|
900
|
+
##
|
901
|
+
# Parses inline markdown in a single table cell
|
902
|
+
|
903
|
+
def parse_cell_inline(text)
|
904
|
+
return text if text.nil? || text.empty?
|
905
|
+
|
906
|
+
# Create a new parser instance for the cell
|
907
|
+
cell_parser = RDoc::Markdown.new(@extensions, @debug)
|
908
|
+
|
909
|
+
# Parse the cell content
|
910
|
+
doc = cell_parser.parse(text)
|
911
|
+
|
912
|
+
# Extract the parsed content
|
913
|
+
if doc && doc.parts && !doc.parts.empty?
|
914
|
+
para = doc.parts.first
|
915
|
+
if para.is_a?(RDoc::Markup::Paragraph)
|
916
|
+
para.parts.join
|
917
|
+
else
|
918
|
+
text
|
919
|
+
end
|
920
|
+
else
|
921
|
+
text
|
922
|
+
end
|
923
|
+
end
|
924
|
+
|
885
925
|
|
886
926
|
# :stopdoc:
|
887
927
|
def setup_foreign_grammar
|
@@ -15955,7 +15995,7 @@ class RDoc::Markdown
|
|
15955
15995
|
return _tmp
|
15956
15996
|
end
|
15957
15997
|
|
15958
|
-
# Table = &{ github? } TableHead:header TableLine:line TableRow+:body {
|
15998
|
+
# Table = &{ github? } TableHead:header TableLine:line TableRow+:body { table = RDoc::Markup::Table.new(header, line, body) parse_table_cells(table) }
|
15959
15999
|
def _Table
|
15960
16000
|
|
15961
16001
|
_save = self.pos
|
@@ -15999,7 +16039,10 @@ class RDoc::Markdown
|
|
15999
16039
|
self.pos = _save
|
16000
16040
|
break
|
16001
16041
|
end
|
16002
|
-
@result = begin;
|
16042
|
+
@result = begin;
|
16043
|
+
table = RDoc::Markup::Table.new(header, line, body)
|
16044
|
+
parse_table_cells(table)
|
16045
|
+
; end
|
16003
16046
|
_tmp = true
|
16004
16047
|
unless _tmp
|
16005
16048
|
self.pos = _save
|
@@ -16790,7 +16833,7 @@ class RDoc::Markdown
|
|
16790
16833
|
Rules[:_Notes] = rule_info("Notes", "(Note | SkipBlock)*")
|
16791
16834
|
Rules[:_RawNoteBlock] = rule_info("RawNoteBlock", "@StartList:a (!@BlankLine !RawNoteReference OptionallyIndentedLine:l { a << l })+ < @BlankLine* > { a << text } { a }")
|
16792
16835
|
Rules[:_CodeFence] = rule_info("CodeFence", "&{ github? } Ticks3 (@Sp StrChunk:format)? Spnl < ((!\"`\" Nonspacechar)+ | !Ticks3 /`+/ | Spacechar | @Newline)+ > Ticks3 @Sp @Newline* { verbatim = RDoc::Markup::Verbatim.new text verbatim.format = format.intern if format.instance_of?(String) verbatim }")
|
16793
|
-
Rules[:_Table] = rule_info("Table", "&{ github? } TableHead:header TableLine:line TableRow+:body {
|
16836
|
+
Rules[:_Table] = rule_info("Table", "&{ github? } TableHead:header TableLine:line TableRow+:body { table = RDoc::Markup::Table.new(header, line, body) parse_table_cells(table) }")
|
16794
16837
|
Rules[:_TableHead] = rule_info("TableHead", "TableItem2+:items \"|\"? @Newline { items }")
|
16795
16838
|
Rules[:_TableRow] = rule_info("TableRow", "((TableItem:item1 TableItem2*:items { [item1, *items] }):row | TableItem2+:row) \"|\"? @Newline { row }")
|
16796
16839
|
Rules[:_TableItem2] = rule_info("TableItem2", "\"|\" TableItem")
|
data/lib/rdoc/version.rb
CHANGED
data/rdoc.gemspec
CHANGED
@@ -53,8 +53,10 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
|
|
53
53
|
"man/ri.1",
|
54
54
|
"rdoc.gemspec",
|
55
55
|
]
|
56
|
-
|
57
|
-
|
56
|
+
base = __dir__
|
57
|
+
not_dir = ->(path) {!File.directory?(File.join(base, path))}
|
58
|
+
template_files = Dir.glob("lib/rdoc/generator/template/**/*", base: base).select(¬_dir)
|
59
|
+
lib_files = Dir.glob("lib/**/*.{rb,kpeg,ry}", base: base).select(¬_dir)
|
58
60
|
|
59
61
|
s.files = (non_lib_files + template_files + lib_files).uniq
|
60
62
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.14.
|
4
|
+
version: 6.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Hodel
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
- ITOYANAGI Sakura
|
14
14
|
bindir: exe
|
15
15
|
cert_chain: []
|
16
|
-
date: 2025-
|
16
|
+
date: 2025-07-03 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: psych
|