Browse Source

Fix the markdown generation for notices;

bjorn 2 months ago
parent
commit
e4c4def478
2 changed files with 3 additions and 3 deletions
  1. 1 1
      api/init.lua
  2. 2 2
      api/main.lua

+ 1 - 1
api/init.lua

@@ -4,7 +4,7 @@ return {
       name = "conf",
       name = "conf",
       tag = "callbacks",
       tag = "callbacks",
       summary = "Called to read configuration settings at startup.",
       summary = "Called to read configuration settings at startup.",
-      description = "The `lovr.conf` callback lets you configure default settings for LÖVR.  It is called once right before the game starts.\n\n:::note Make sure you put `lovr.conf` in a file called `conf.lua`, a special file that's loaded before the rest of the framework initializes. :::",
+      description = "The `lovr.conf` callback lets you configure default settings for LÖVR.  It is called once right before the game starts.\n\n:::note\nMake sure you put `lovr.conf` in a file called `conf.lua`, a special file that's loaded before the rest of the framework initializes.\n:::",
       key = "lovr.conf",
       key = "lovr.conf",
       module = "lovr",
       module = "lovr",
       examples = {
       examples = {

+ 2 - 2
api/main.lua

@@ -25,8 +25,8 @@ end
 local function unwrap(str)
 local function unwrap(str)
   if not str then return str end
   if not str then return str end
   str = unindent(str)
   str = unindent(str)
-  return str:gsub('([^\n])\n(%S)', function(a, b)
-    if b == '-' or b == '>' then
+  return str:gsub('([^\n]+)\n(%S)', function(a, b)
+    if b == '-' or b == '>' or b == ':' or a:match(':::') then
       return a .. '\n' .. b
       return a .. '\n' .. b
     else
     else
       return a .. ' ' .. b
       return a .. ' ' .. b