SimpleChatTCRV:MarkDown:Tables initial skeleton
Try create a table head
This commit is contained in:
parent
03220d4a2b
commit
3cc5bd01ae
|
|
@ -9,7 +9,7 @@ export class MarkDown {
|
|||
constructor() {
|
||||
this.in = {
|
||||
preFenced: "",
|
||||
table: false,
|
||||
table: 0,
|
||||
/** @type {Array<number>} */
|
||||
listUnordered: []
|
||||
}
|
||||
|
|
@ -28,6 +28,28 @@ export class MarkDown {
|
|||
this.unwind_list_unordered()
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} line
|
||||
*/
|
||||
process_table_line(line) {
|
||||
let lineParts = line.match(/^(|.*)*|$/)
|
||||
if (lineParts != null) {
|
||||
if (this.in.table == 0) {
|
||||
// table heading
|
||||
this.html += "<table>\n<thead>\n"
|
||||
for(let i=1; i<lineParts.length; i++) {
|
||||
this.html += `<th>${lineParts[i]}</th>\n`
|
||||
}
|
||||
this.html += "</thead>\n"
|
||||
this.in.table = lineParts.length-1;
|
||||
return
|
||||
}
|
||||
if (this.in.table > 0) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a line from markdown content
|
||||
* @param {string} line
|
||||
|
|
|
|||
Loading…
Reference in New Issue