Explorar o código

insert start line number and end line number of table into button attr

utsushiiro %!s(int64=7) %!d(string=hai) anos
pai
achega
b8a33481a7
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/client/js/util/markdown-it/table.js

+ 3 - 1
src/client/js/util/markdown-it/table.js

@@ -6,7 +6,9 @@ export default class TableConfigurer {
 
   configure(md) {
     md.renderer.rules.table_open = (tokens, idx) => {
-      return '<div><button></button><table class="table table-bordered">';
+      const beginLine = tokens[idx].map[0] + 1;
+      const endLine  = tokens[idx].map[1];
+      return `<div><button data-markdowntable-begin-line=${beginLine} data-markdown-table-end-line=${endLine}></button><table class="table table-bordered">`;
     };
 
     md.renderer.rules.table_close = (tokens, idx) => {