Comments (4)
And on my computer, that code gives:
<p><a href="http://example.com/?%9F">Test</a></p>
Which is still incorrect. Looks like this will require some more investigation.
from rdiscount.
It appears that RDiscount 2.0.7 is not actually using Discount 2.0.7, or at least not the final version. Apparently the original pull request to pull in the Discount 2.0.7 sources wasn't correct.
sigh... Look like a bugfix release will be coming soon.
FWIW, Discount 2.0.7 does not have the bug you mention. Thus neither should the bugfixed RDiscount 2.0.7.
from rdiscount.
Ugh what a hideous bug...
Both Discount and RDiscount are calling mkd_string
using exactly the same input - byte for byte. Yet are returning different results. How on earth can this be?
I traced the altered return data to puturl
, which is responsible for percent-encoding special characters (ex: ß -> %C3%9F). It wasn't encoding %C3. Why not? Its decision to do this is based on isalnum(0xC3)
, which determines whether a character is alpha-numeric. And apparently this function changes its behavior based on the current global locale. Argh!
Ruby uses the locale en_US.UTF-8
on my machine, where isalpha(0xC3) => true
. Everybody else uses the default locale of C
(ASCII), where isalpha(0xC3) => false
.
[rant] I can't believe this behavior of isalnum
... UTF-8 codepoints cannot fit into a single 8-bit unsigned char
value, so it is foolhardy for isalpha
to try to process an 8-bit value as if it were an UTF-8 codepoint. [/rant]
Summary: The behavior of isalpha
is ill-defined for any locale with codepoints requiring more than 8 bits - notably UTF-8 or any Unicode encoding.
from rdiscount.
Fixed on master branch.
from rdiscount.
Related Issues (20)
- Integrate/cull unrecognized RDiscount git branches HOT 1
- rdiscount render same header id for all headers HOT 7
- LaTeX support HOT 25
- Unicode headers produce invalid anchors HOT 1
- extconf.rb failed - Could not create Makefile due to some reason HOT 7
- Bump Discount to v2.2.0+ HOT 6
- MarkdownTest_1.0.3 tests have diverged from the original source? HOT 6
- Allow stricter handling of consecutive bullet lists with MKD_EXPLICITLIST flag HOT 6
- TOC generation unclear HOT 2
- Prepending links and images with a base folder HOT 4
- Install error with Xcode 12 beta HOT 3
- RDiscount to support Jekyll 4.0 via plugin
- Upgrade to latest version of Discount (2.2.6 currently) HOT 3
- filter_styles not working HOT 2
- Docs seem to be broken HOT 1
- Links with right parenthesis rendering HOT 3
- Supporting Clang 16 (the latest release) HOT 9
- Qchar_mkd_sta_function_t should return a value but returns nothing HOT 2
- Make permanent: Fixes for clang 16 and TruffleRuby HOT 1
- v2.2.7.2 does not compile on Ruby 3.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdiscount.