File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
Name: bbcode
3
3
Type: module
4
4
Options: [delay]
5
- Version: 0.3.0
5
+ Version: 0.3.1
6
6
Title: "Codec: BBcode"
7
7
Purpose: {Basic BBCode implementation. For more info about BBCode check http://en.wikipedia.org/wiki/BBCode}
8
8
File: https://raw.githubusercontent.com/Oldes/Rebol3/master/src/mezz/codec-bbcode.reb
@@ -13,6 +13,7 @@ REBOL [
13
13
0.2.0 19-Feb-2012 "review"
14
14
0.2.1 22-Aug-2012 "added [hr] and [anchor]"
15
15
0.3.0 24-Apr-2020 "ported to Rebol3"
16
+ 0.3.1 11-Dec-2023 "FIX: `bbcode` must accept only string input"
16
17
]
17
18
]
18
19
@@ -195,7 +196,7 @@ enabled-tags: [
195
196
196
197
bbcode : func [
197
198
"Converts BBCode markup into HTML"
198
- code [string! binary! ] "Input with BBCode tags"
199
+ code [string! ] "Input with BBCode tags"
199
200
/local tag err
200
201
] [
201
202
err: try [
@@ -438,8 +439,10 @@ register-codec [
438
439
/local result
439
440
return: [string! ]
440
441
] [
441
- if any [file? code url? code][code: read code]
442
+ switch type? /word code [
443
+ binary! [code: to string! code]
444
+ file! url! [code: read /string code]
445
+ ]
442
446
result: bbcode code
443
-
444
447
]
445
448
]
Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ if find codecs 'BBCode [
88
88
print "---"
89
89
]
90
90
]
91
+ --test-- "bbcode with binary input"
92
+ src: {text [b]bold[/b] abc}
93
+ --assert (decode 'bbcode srt) = (decode 'bbcode to binary! src)
91
94
92
95
===end-group===
93
96
]
You can’t perform that action at this time.
0 commit comments