Skip to content

unicode non breaking space - #6

Closed
staugaard wants to merge 1 commit into
mainfrom
staugaard/unicode_non_breaking_space
Closed

staugaard wants to merge 1 commit into
mainfrom
staugaard/unicode_non_breaking_space

Conversation

@staugaard

Copy link
Copy Markdown

Failing test for URLs with trailing unicode non-breaking-space

@staugaard
staugaard force-pushed the staugaard/unicode_non_breaking_space branch from 8f9ee68 to 81b3885 Compare October 14, 2015 16:54
@staugaard

Copy link
Copy Markdown
Author

@jcheatham @ckumar1 @shajith Any of you know how to fix this?

@jcheatham

Copy link
Copy Markdown

@jcheatham

Copy link
Copy Markdown

@staugaard
staugaard force-pushed the staugaard/unicode_non_breaking_space branch from 81b3885 to f55f02f Compare October 14, 2015 17:27
@staugaard

Copy link
Copy Markdown
Author

I tried, but I don't understand the flow in the code.

@jcheatham

Copy link
Copy Markdown

I'm having trouble getting the tests to run at the moment, but should be able to do something like:

diff --git a/ext/rinku/autolink.c b/ext/rinku/autolink.c
index c3e86e0..01bbc4a 100644
--- a/ext/rinku/autolink.c
+++ b/ext/rinku/autolink.c
@@ -379,6 +379,10 @@ is_unicode_space(uint8_t *data, size_t offset) {
                                return 1;
                        }
                }
+       } else if (data[offset] == 0xC2) {
+               if (data[offset+1] == 0xA0) {
+                       return 1;
+               }
        }

        return 0;

@mariozaizar
mariozaizar deleted the staugaard/unicode_non_breaking_space branch June 23, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants