Mercurial Hosting > freedit
diff src/thread.html.luan @ 12:ad1604c72156
fix bbcode
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 03 Jul 2022 22:01:23 -0600 |
parents | 3ed1e3f3a53a |
children | 0edde02b908c |
line wrap: on
line diff
--- a/src/thread.html.luan Thu Jun 30 20:05:11 2022 -0600 +++ b/src/thread.html.luan Sun Jul 03 22:01:23 2022 -0600 @@ -1,12 +1,7 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local ipairs = Luan.ipairs or error() -local Html = require "luan:Html.luan" -local html_encode = Html.encode or error() -local Parsers = require "luan:Parsers.luan" -local bbcode_to_html = Parsers.bbcode_to_html or error() local Io = require "luan:Io.luan" -local output_of = Io.output_of or error() local Http = require "luan:http/Http.luan" local Shared = require "site:/lib/Shared.luan" local head = Shared.head or error() @@ -16,24 +11,9 @@ local forum_title = Forum.title or error() local Db = require "site:/lib/Db.luan" local Post = require "site:/lib/Post.luan" -local User = require "site:/lib/User.luan" - +local Bbcode = require "site:/lib/Bbcode.luan" +local bbcode_to_html = Bbcode.to_html or error() -local function quoter(content,user_name) - return output_of( function() - %><blockquote><% - if user_name ~= nil then - local user = User.get_by_name(user_name) - if user == nil then - %><%= html_encode(user_name) %> wrote:<% - else - %><a href="/user_somthing"><%= html_encode(user_name) %></a> wrote:<% - end - end - %><%= content %><% - %></blockquote><% - end_function ) -end return function() local root_id = Http.request.parameters.root or error() @@ -59,7 +39,7 @@ <h1><%=subject_html%></h1> <% for _, post in ipairs(posts) do %> <hr> - <div post><%=bbcode_to_html(post.content,quoter)%></div> + <% bbcode_to_html(post.content) %> <p> <a href="/reply.html?parent=<%=post.id%>">reply</a> - <a href="/edit.html?post=<%=post.id%>">edit</a>