markly 0.14.0 → 0.14.1
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
- checksums.yaml.gz.sig +0 -0
- data/lib/markly/renderer/html.rb +4 -15
- data/lib/markly/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb58c81c8fca95217e5a1469baf3034785126d6ff42e9929a7d074e358b9508
|
4
|
+
data.tar.gz: f28760fe0280ce1ab132d7ec639584284dde3ba8077e68f2cd3617715d1211cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded6fff6a6355a8e78b2daa19a1581d982a35ddbcbddc38efe25d1866e9ce6136ea6eea62c1638874ff9953546a176df11e6ce462c9131ab38648185dec50a7a
|
7
|
+
data.tar.gz: ccc6eb379235978b3a512dee8553a425ca456b01e9f60b10d16927ae1862cda069152fcc62a02a1a60d46b274a1c8aa760183a636c528b8cdc7fdf43a367abd8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/markly/renderer/html.rb
CHANGED
@@ -39,24 +39,13 @@ module Markly
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.anchor_for(node)
|
42
|
-
# Convert to plaintext, strip trailing whitespace, convert to lowercase
|
42
|
+
# Convert to plaintext, strip trailing whitespace, convert to lowercase:
|
43
43
|
text = node.to_plaintext.chomp.downcase
|
44
44
|
|
45
|
-
# Replace sequences of whitespace with hyphens
|
46
|
-
text
|
45
|
+
# Replace sequences of whitespace with hyphens:
|
46
|
+
text.gsub!(/\s+/, "-")
|
47
47
|
|
48
|
-
|
49
|
-
text = text.gsub(/\./, "-")
|
50
|
-
|
51
|
-
# Remove characters that are not URL-safe for anchors
|
52
|
-
# Keep: letters, numbers, hyphens, underscores
|
53
|
-
# Remove: punctuation, special characters, symbols
|
54
|
-
text = text.gsub(/[^\w\-]/, "")
|
55
|
-
|
56
|
-
# Remove leading/trailing hyphens and collapse multiple hyphens
|
57
|
-
text = text.gsub(/^-+|-+$/, "").gsub(/-+/, "-")
|
58
|
-
|
59
|
-
text
|
48
|
+
return text
|
60
49
|
end
|
61
50
|
|
62
51
|
def anchor_for(node)
|
data/lib/markly/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
+��;��}�B
|
2
|
+
���|�C�R� ױN ������ ���
|
3
|
+
�.�� ט��4���B�p�`��Lbp/�F�h�H]<.����)�$��$$n`����W�]�.n���váA�-�{O��R�c"v����@�@���23D����$RY�ヮ��F�XR�oT���J��ѬP��
|