Enable reader mode
Various fixes to enable reader mode on most platforms. I tested on firefox, google chrome, and microsoft edge, I don't have an iphone, so let me know if it's still broken.
This commit is contained in:
parent
2e735282ec
commit
03d4779129
|
@ -70,7 +70,7 @@ local grammar = P{
|
|||
marked = V"spoiler" + V"bold" + V"italic" + V"underline" + V"heading" + V"strike" + V"spoiler2" + V"code",
|
||||
plainline = (V"marked" + word)^0,
|
||||
line = Cs(V"greentext" + V"pinktext" + V"plainline" + P"") * P"\n" / function(a)
|
||||
return string.format("%s<br/>",a)
|
||||
return string.format("<p>%s",a)
|
||||
end,
|
||||
ending = C(P(1)^0) / sanitize,
|
||||
chunk = V"line"^0 * V"plainline" * V"ending"
|
||||
|
|
|
@ -6,7 +6,7 @@ local escapes = {
|
|||
['"'] = """,
|
||||
["'"] = "'",
|
||||
--Kinda hacky
|
||||
["\n"] = "<br/>",
|
||||
["\n"] = "<p>",
|
||||
}
|
||||
local esctbl = {}
|
||||
for char,_ in pairs(escapes) do
|
||||
|
@ -18,5 +18,7 @@ local function sanitize(capture)
|
|||
return escapes[capture] or capture
|
||||
end
|
||||
return function(text)
|
||||
return string.gsub(text,escapematch,sanitize)
|
||||
text = string.gsub(text,escapematch,sanitize)
|
||||
--text = string.gsub(text,"\n\n","<p>")
|
||||
return text
|
||||
end
|
||||
|
|
|
@ -2,33 +2,33 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><%= title %></title>
|
||||
<meta name="author" content="<%= author %>">
|
||||
<title><%- title %></title>
|
||||
<link href="/_css/milligram.css" rel="stylesheet">
|
||||
<link href="/_css/style.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="container">
|
||||
<main class="wrapper">
|
||||
<h1>
|
||||
<body><main class="wrapper">
|
||||
<nav>
|
||||
<a href="https://<%= domain %>"><%= domain %></a>/<a href="https://<%= domain %>/<%= idp %>"><%= idp %></a>
|
||||
</h1>
|
||||
</nav>
|
||||
<% if owner then %>
|
||||
<form action="https://<%= domain %>/_edit" method="get"><fieldset>
|
||||
<input type="hidden" name="story" value="<%= idp %>"/>
|
||||
<input type="submit" value="edit" class="button"/>
|
||||
</fieldset></form>
|
||||
<% end %>
|
||||
<h1 class="title">
|
||||
<h2 class="title">
|
||||
<%- title %>
|
||||
</h1>
|
||||
</h2>
|
||||
<h3>
|
||||
<% if isanon then %>
|
||||
By Anonymous
|
||||
<% else %>
|
||||
By <a href="https://<%= author %>.<%= domain %>"><%= author %></a>
|
||||
<% end %>
|
||||
<article class="container content">
|
||||
</h3>
|
||||
<%- text %>
|
||||
</article>
|
||||
</main>
|
||||
</body>
|
||||
</main></body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue