parent
e0ec91ee29
commit
d0c6693ff7
16
main.js
16
main.js
|
@ -552,7 +552,7 @@ function showoutline()
|
||||||
getnotecontent().split("\n").forEach((line, index, lines) =>
|
getnotecontent().split("\n").forEach((line, index, lines) =>
|
||||||
{
|
{
|
||||||
pos += line.length + 1;
|
pos += line.length + 1;
|
||||||
if (line.startsWith("#") || line == "---")
|
if (line.startsWith("#"))
|
||||||
{
|
{
|
||||||
line = line
|
line = line
|
||||||
.replace("# ", "")
|
.replace("# ", "")
|
||||||
|
@ -602,12 +602,20 @@ function linkatpos()
|
||||||
|
|
||||||
function tagatpos()
|
function tagatpos()
|
||||||
{
|
{
|
||||||
|
if (md.value.lastIndexOf("tags: ", md.selectionStart) < md.value.lastIndexOf("\n", md.selectionStart))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var start = md.value.lastIndexOf(" ", md.selectionStart);
|
var start = md.value.lastIndexOf(" ", md.selectionStart);
|
||||||
if (start == -1 || md.value.substring(start, md.selectionStart).indexOf("\n") != -1) return "";
|
if (start == -1 || md.value.substring(start, md.selectionStart).indexOf("\n") != -1) return "";
|
||||||
|
|
||||||
var nextcomma = md.value.indexOf(",", md.selectionStart);
|
var end = md.value.indexOf(",", md.selectionStart);
|
||||||
var nexteol = md.value.indexOf("\n", md.selectionStart);
|
if (end == -1)
|
||||||
var end = Math.min(nexteol, nextcomma);
|
{
|
||||||
|
end = md.value.indexOf("\n", md.selectionStart);
|
||||||
|
}
|
||||||
|
|
||||||
if (end == -1 || md.value.substring(md.selectionStart, end).indexOf("\n") != -1) return "";
|
if (end == -1 || md.value.substring(md.selectionStart, end).indexOf("\n") != -1) return "";
|
||||||
|
|
||||||
return md.value.substring(start + 1, end);
|
return md.value.substring(start + 1, end);
|
||||||
|
|
Loading…
Reference in New Issue