Explorar el Código

f*ck the regexps

Ivan Asmer hace 4 años
padre
commit
5c4b7b7cb6
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6 6
      index.mjs

+ 6 - 6
index.mjs

@@ -191,7 +191,7 @@ const syntax = {
     heading6: {
         paired: true,
         recursive: true,
-        startRegexp: /\n######[ \t]*([^\[]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
+        startRegexp: /\n######[ \t]*([^\[\n]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
         endRegexp: /\n#\s/,
         content: {
             start: {
@@ -219,7 +219,7 @@ const syntax = {
     heading5: {
         paired: true,
         recursive: true,
-        startRegexp: /\n#####[ \t]*([^\[]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
+        startRegexp: /\n#####[ \t]*([^\[\n]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
         endRegexp: /\n#{1,5}\s/,
         content: {
             start: {
@@ -248,7 +248,7 @@ const syntax = {
     heading4: {
         paired: true,
         recursive: true,
-        startRegexp: /\n####[ \t]*([^\[]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
+        startRegexp: /\n####[ \t]*([^\[\n]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
         endRegexp: /\n#{1,4}\s/,
         content: {
             start: {
@@ -277,7 +277,7 @@ const syntax = {
     heading3: {
         paired: true,
         recursive: true,
-        startRegexp: /\n###[ \t]*([^\[]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
+        startRegexp: /\n###[ \t]*([^\[\n]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
         endRegexp: /\n#{1,3}\s/,
         content: {
             start: {
@@ -306,7 +306,7 @@ const syntax = {
     heading2: {
         paired: true,
         recursive: true,
-        startRegexp: /\n##[ \t]*([^\[]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
+        startRegexp: /\n##[ \t]*([^\[\n]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
         endRegexp: /\n#{1,2}\s/,
         content: {
             start: {
@@ -335,7 +335,7 @@ const syntax = {
     heading1: {
         paired: true,
         recursive: true,
-        startRegexp: /\n#[ \t]*([^\[]*)(\[#(\S*)[ \t]*(.*)\])?\n/m,
+        startRegexp: /\n#[ \t]*([^\[\n]*)(\[#(\S*)[ \t]*(.*)\])?\n/,
         endRegexp: /\n#\s/,
         content: {
             start: {