Skip to content

Commit

Permalink
Same urlize() everywhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFreezed committed May 31, 2021
1 parent 797c446 commit 25e4351
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Author:** Niklas Frykholm, <[email protected]>
**Date:** 31 May 2008
**Edited by:** Marcus Thunström (2018-06-14, 2021-05-06)
**Edited by:** Marcus Thunström (2018-06-14, 2021-05-31)
This is an implementation of the popular text markup language Markdown in pure Lua.
Markdown can convert documents written in a simple and easy to read text format
Expand Down Expand Up @@ -271,16 +271,6 @@ local function strip_html(html)
return text
end

local function urlize(text)
text = text
:lower()
:gsub("[%p ]+", "-")
:gsub("^%-+", "")
:gsub("%-+$", "")

return text == "" and "-" or text
end

----------------------------------------------------------------------
-- Hash
----------------------------------------------------------------------
Expand Down

0 comments on commit 25e4351

Please sign in to comment.