From 537b2e7e66928e6d73ac4d16d89f55d296c38a01 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 8 Dec 2019 09:43:47 -0500 Subject: [PATCH] permit more characters in links --- lib/philomena_web/templates/comment/index.html.slime | 2 +- lib/philomena_web/templates/post/index.html.slime | 2 +- lib/textile/lexer.ex | 6 +++--- lib/textile/url_lexer.ex | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/philomena_web/templates/comment/index.html.slime b/lib/philomena_web/templates/comment/index.html.slime index 3a51e9f7..c02c46cf 100644 --- a/lib/philomena_web/templates/comment/index.html.slime +++ b/lib/philomena_web/templates/comment/index.html.slime @@ -3,7 +3,7 @@ h1 Comments = form_for :comments, Routes.comment_path(@conn, :index), [method: "get", class: "hform", enforce_utf8: false], fn f -> .field = text_input f, :cq, name: :cq, value: @conn.params["cq"], class: "input hform__text", placeholder: "Search comments", autocapitalize: "none" - = submit "Search", class: "hform__button button", data: [disable_with: false] + = submit "Search", class: "hform__button button" .fieldlabel ' For more information, see the diff --git a/lib/philomena_web/templates/post/index.html.slime b/lib/philomena_web/templates/post/index.html.slime index 427e42d3..9a31a217 100644 --- a/lib/philomena_web/templates/post/index.html.slime +++ b/lib/philomena_web/templates/post/index.html.slime @@ -3,7 +3,7 @@ h1 Posts = form_for :posts, Routes.post_path(@conn, :index), [method: "get", class: "hform", enforce_utf8: false], fn f -> .field = text_input f, :pq, name: :pq, value: @conn.params["pq"], class: "input hform__text", placeholder: "Search posts", autocapitalize: "none" - = submit "Search", class: "hform__button button", data: [disable_with: false] + = submit "Search", class: "hform__button button" .fieldlabel ' For more information, see the diff --git a/lib/textile/lexer.ex b/lib/textile/lexer.ex index 1de3c2ad..a87d7455 100644 --- a/lib/textile/lexer.ex +++ b/lib/textile/lexer.ex @@ -128,9 +128,9 @@ defmodule Textile.Lexer do string("@"), string("^"), string("~"), - string("."), - string("!"), - string(","), + string(".") |> concat(choice([space(), eos()])), + string("!") |> concat(choice([space(), eos()])), + string(",") |> concat(choice([space(), eos()])), string("_") |> concat(choice([space(), eos()])), string("?") |> concat(choice([space(), eos()])), string(";") |> concat(choice([space(), eos()])), diff --git a/lib/textile/url_lexer.ex b/lib/textile/url_lexer.ex index dcd5ef3f..112df9a1 100644 --- a/lib/textile/url_lexer.ex +++ b/lib/textile/url_lexer.ex @@ -20,6 +20,7 @@ defmodule Textile.UrlLexer do scheme_and_domain = choice([ + string("#"), string("/"), string("data:image/"), string("https://") |> concat(domain),