From b950889f47df613d2a69d8143ebc5a55099f066b Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 29 Jun 2023 19:01:25 -0700 Subject: [PATCH] Fix org-mode web renderer to handle results containing list in block - Break out of rendering list if at end of org block in org.js - This would previous hang rendering results in web interface Should try fix this upstream in org.js as well --- src/khoj/interface/web/assets/org.min.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/khoj/interface/web/assets/org.min.js b/src/khoj/interface/web/assets/org.min.js index 0a870c9c..a919b280 100644 --- a/src/khoj/interface/web/assets/org.min.js +++ b/src/khoj/interface/web/assets/org.min.js @@ -614,8 +614,10 @@ var Org = (function () { var notBlankNextToken = this.lexer.peekNextToken(); if (blankToken && !notBlankNextToken.isListElement()) this.lexer.pushToken(blankToken); // Recover blank token only when next line is not listElement. - if (notBlankNextToken.indentation <= rootIndentation) - break; // end of the list + // End of the list if hit less indented line or end of directive + if (notBlankNextToken.indentation <= rootIndentation || + (notBlankNextToken.type === Lexer.tokens.directive && notBlankNextToken.endDirective)) + break; var element = this.parseElement(); // recursive if (element)