A Markdown shard for the Crystal programming language
Revisión | d548a69d401dedf9989ee17f29e801b30ac11ee8 (tree) |
---|---|
Tiempo | 2023-12-07 13:36:33 |
Autor | Mio <supercell@nore...> |
Commiter | Mio |
Merge pull request 'Fixed issues with paren and autolink' (#3) from solvin/luce:master into master
Reviewed-on: https://codeberg.org/supercell/luce/pulls/3
@@ -62,7 +62,7 @@ class DartURI | ||
62 | 62 | # method |
63 | 63 | # ([src](https://github.com/dart-lang/sdk/blob/2.14.0-371.0.dev/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart#L875)). |
64 | 64 | def self.encode_full(uri : String) : String |
65 | - uri_encode(ENCODE_FULL_TABLE, uri, "utf8", false) | |
65 | + uri_encode(ENCODE_FULL_TABLE, uri, "UTF-8", false) | |
66 | 66 | end |
67 | 67 | |
68 | 68 | # Encode the string *component* using percent-encoding to make it |
@@ -84,7 +84,7 @@ class DartURI | ||
84 | 84 | # puts encoded # => http%3A%2F%2Fexample.com%2Fsearch%3DCrystal |
85 | 85 | # ``` |
86 | 86 | def self.encode_component(component : String) : String |
87 | - uri_encode(UNRESERVED_2396_TABLE, component, "utf8", false) | |
87 | + uri_encode(UNRESERVED_2396_TABLE, component, "UTF-8", false) | |
88 | 88 | end |
89 | 89 | |
90 | 90 | private def self.uri_encode(canonical_table : Array(Int32), text : String, encoding : String, space_to_plus : Bool) : String |
@@ -107,7 +107,7 @@ module Luce | ||
107 | 107 | if text.ends_with? ")" |
108 | 108 | match = /(\(.*)?(\)+)$/.match(text).not_nil! |
109 | 109 | |
110 | - if match[1].nil? | |
110 | + if !match[1]? | |
111 | 111 | excluded_length = match[2].not_nil!.size |
112 | 112 | else |
113 | 113 | paren_count = 0 |