Skip to content

Build your personal knowledge base with Trilium Notes

Fixes #1: Some tables were imported with an extra header

Laurent Cozicc00d538f88f5
diff --git a/build_for_test.sh b/build_for_test.sh
index 8401c24f6f..abdf1c4d7a 100755
--- a/build_for_test.sh
+++ b/build_for_test.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-ROOT_DIR=/Users/laurent/src/joplin
+ROOT_DIR=/mnt/c/Users/laurent/src/joplin
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -e
npm run build
diff --git a/src/tables.js b/src/tables.js
index d48842817e..86aa7e9e52 100644
--- a/src/tables.js
+++ b/src/tables.js
@@ -53,7 +53,7 @@ rules.table = {
content = content.replace(/\n+/g, '\n')
// If table has no heading, add an empty one so as to get a valid Markdown table
- var secondLine = content.split('\n');
+ var secondLine = content.trim().split('\n');
if (secondLine.length >= 2) secondLine = secondLine[1]
var secondLineIsDivider = secondLine.indexOf('| ---') === 0