Laut Doku soll Text::Textile (Version 2.12) beim Markupcode
bc eingebundene Klammern (<>) HTML-escapen.
https://metacpan.org/pod/Text::Textile#bcbc
A "bc" signature is short for "block code", which implies a preformatted section like the "pre" block, but it also gets a <code> tag (or for XHTML 2, a <blockcode> tag is used instead).
Note that within a "bc" block, < and > are translated into HTML entities automatically.
Die aktuelle Version tut es aber nicht.
Testcase:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict; use warnings;
use Text::Textile;
my $textile = Text::Textile->new;
my $code = <<'CODE';
bc.. <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de" xml:lang="de">
<script src="/test/test.js" type="text/javascript"></script>
<head>
<title>Test</title>
bc. <?xml version="1.0" encoding="UTF-8"?>
bc. <script src="/test/test.js" type="text/javascript"></script>
CODE
print $textile->process($code);
ezeugt:
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de" xml:lang="de">
<script src="/test/test.js" type="text/javascript"></script>
<head>
<title>Test</title></code></pre>
<pre><code><?xml version="1.0" encoding="UTF-8"?></code></pre>
<pre><code><script src="/test/test.js" type="text/javascript"></script></code></pre>
bc maskiert also die Klammer bei
<? ?> oder bei
<script> nicht korrekt.
//EDIT:
ich habe einen funktionierenden Fix geschrieben.
Textile.pm /
Diff
Bug und Patch wurde als
Issue #3 bei GitHub an Maintainer gemeldet (ob er's fixt, weiß ich nicht).
Editiert von GwenDragon: Link auf aktuellen Fix
Anhänge
Last edited: 2014-07-14 19:58:14 +0200 (CEST)