7
0
forked from pool/lua-markdown

6 Commits

6 changed files with 60 additions and 5 deletions

1
.gitattributes vendored
View File

@@ -21,3 +21,4 @@
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*.changes merge=merge-changes

6
.gitignore vendored
View File

@@ -1 +1,5 @@
.osc
*.obscpio
*.osc
_build.*
.pbuild
lua*-markdown-*-build/

View File

@@ -1,5 +1,6 @@
<multibuild>
<package>lua51</package>
<package>luajit</package>
<package>lua53</package>
<package>lua54</package>
<package>lua55</package>
</multibuild>

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Thu Jan 22 14:45:56 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
- Add lua55-build.patch to fix incompatibility with Lua 5.5
(gh#mpeterv/markdown!8).
-------------------------------------------------------------------
Fri Oct 24 14:50:24 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Switch off building lua51 build of the package.
-------------------------------------------------------------------
Sun Oct 12 00:36:30 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Make the package buildable with LuaJIT.
-------------------------------------------------------------------
Wed Nov 23 10:39:52 UTC 2022 - Michal Suchanek <msuchanek@suse.com>

View File

@@ -25,6 +25,9 @@ Summary: Markdown text-to-html markup system
License: MIT
URL: https://github.com/mpeterv/markdown
Source: https://github.com/mpeterv/markdown/archive/%{upversion}.tar.gz#/%{mod_name}-%{upversion}.tar.gz
# PATCH-FIX-UPSTREAM lua55-build.patch gh#mpeterv/markdown!8 mcepl@suse.com
# Fix incompatibility with Lua 5.5
Patch0: lua55-build.patch
BuildRequires: %{flavor}-devel
BuildRequires: lua-macros
Requires: %{flavor}
@@ -41,17 +44,17 @@ Name: %{flavor}-%{mod_name}
A pure-lua implementation of the Markdown text-to-html markup system.
%prep
%setup -q -n %{mod_name}-%{upversion}
%autosetup -p1 -n %{mod_name}-%{upversion}
sed -i '\|%{_bindir}/env |d' markdown.lua
%build
/bin/true
:
%install
install -v -D -m 0644 -p -t %{buildroot}%{lua_noarchdir} markdown.lua
%check
lua%{lua_version} markdown-tests.lua
lua markdown-tests.lua
%files
%license LICENSE

30
lua55-build.patch Normal file
View File

@@ -0,0 +1,30 @@
---
markdown.lua | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: markdown-0.33/markdown.lua
===================================================================
--- markdown-0.33.orig/markdown.lua 2026-01-22 15:31:50.217036340 +0100
+++ markdown-0.33/markdown.lua 2026-01-22 15:35:12.767885110 +0100
@@ -254,8 +254,8 @@
-- Unprotects the specified text by expanding all the nonces
local function unprotect(text)
for k,v in pairs(PD.blocks) do
- v = v:gsub("%%", "%%%%")
- text = text:gsub(k, v)
+ local escaped_v = v:gsub("%%", "%%%%")
+ text = text:gsub(k, escaped_v)
end
return text
end
@@ -686,8 +686,8 @@
local function unescape_special_chars(t)
local tin = t
for k,v in pairs(escape_table) do
- k = k:gsub("%%", "%%%%")
- t = t:gsub(v,k)
+ local escaped_k = k:gsub("%%", "%%%%")
+ t = t:gsub(v,escaped_k)
end
if t ~= tin then t = unescape_special_chars(t) end
return t