From 5edec22e28ba4940ba3cad14aac8ce432e517f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 27 Mar 2014 16:57:46 +0100 Subject: [PATCH] fix the build --- app/assets/javascripts/discourse/lib/markdown.js | 4 ++++ .../mdtest/fixtures/Links, reference style.text | 2 +- .../mdtest/fixtures/Links, reference style.xhtml | 14 +++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/markdown.js b/app/assets/javascripts/discourse/lib/markdown.js index 00748dfae1c..7d408619517 100644 --- a/app/assets/javascripts/discourse/lib/markdown.js +++ b/app/assets/javascripts/discourse/lib/markdown.js @@ -134,6 +134,10 @@ Discourse.Markdown = { if(/^(https?:)?\/\/[\w\.\-]+/i.test(url)) { return url; } // relative urls if(/^\/[\w\.\-]+/i.test(url)) { return url; } + // anchors + if(/^#[\w\.\-]+/i.test(url)) { return url; } + // mailtos + if(/^mailto:[\w\.\-@]+/i.test(url)) { return url; } }, /** diff --git a/test/javascripts/mdtest/fixtures/Links, reference style.text b/test/javascripts/mdtest/fixtures/Links, reference style.text index 341ec88e3d0..96d4470d10b 100755 --- a/test/javascripts/mdtest/fixtures/Links, reference style.text +++ b/test/javascripts/mdtest/fixtures/Links, reference style.text @@ -56,7 +56,7 @@ In this case, [this](/somethingelse/) points to something else. Backslashing should suppress \[this] and [this\]. -[this]: foo +[this]: #foo * * * diff --git a/test/javascripts/mdtest/fixtures/Links, reference style.xhtml b/test/javascripts/mdtest/fixtures/Links, reference style.xhtml index 8e70c32f4d4..9eb8ffe694c 100755 --- a/test/javascripts/mdtest/fixtures/Links, reference style.xhtml +++ b/test/javascripts/mdtest/fixtures/Links, reference style.xhtml @@ -19,15 +19,15 @@
-

this should work

+

this should work

-

So should this.

+

So should this.

-

And this.

+

And this.

-

And this.

+

And this.

-

And this.

+

And this.

But not [that] [].

@@ -35,9 +35,9 @@

Nor [that].

-

[Something in brackets like this should work]

+

[Something in brackets like this should work]

-

[Same with this.]

+

[Same with this.]

In this case, this points to something else.