Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html link replace issue #12

Closed
perlmonk opened this issue Aug 28, 2012 · 4 comments
Closed

html link replace issue #12

perlmonk opened this issue Aug 28, 2012 · 4 comments

Comments

@perlmonk
Copy link

There is a space in markdown process result, I fix it by change Utils.java, patch here :)

<a href="http://test.com">test</a>

to

<p><a href="http: //test.com">test</a></p>
diff --git a/src/main/java/com/github/rjeschke/txtmark/Utils.java b/src/main/java/com/github/rjeschke/txtmark/Utils.java
index 2e19c08..5339893 100644
--- a/src/main/java/com/github/rjeschke/txtmark/Utils.java
+++ b/src/main/java/com/github/rjeschke/txtmark/Utils.java
@@ -530,7 +530,7 @@
            pos = readRawUntil(out, in, pos, '/', '>');
            if(in.charAt(pos) == '/')
            {
-               out.append(" /");
+               out.append("/"); // a 'space' prefix will cause 'http://test.com' become 'http: //test.com'
                pos = readRawUntil(out, in, pos + 1, '>');
                if(pos == -1)
                    return -1;
@rjeschke
Copy link
Owner

Ah ... damn. Will have a look at it, don't know why it ignores strings.

Edit: I will replace the readRawUntil method with something aware of XML attributes, so it will correctly parse strings.

@jpparsons
Copy link

Has this fix been released? I have the latest Maven jar 0.8 and see this issue still exists.

@rjeschke
Copy link
Owner

Fixed in 0.9, gets released this evening.

@jpparsons
Copy link

Thank you! Much appreciated.

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

No branches or pull requests

3 participants