Преглед изворни кода

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

utsushiiro пре 7 година
родитељ
комит
b8a33481a7
1 измењених фајлова са 3 додато и 1 уклоњено
  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) => {