File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -843,7 +843,7 @@ private void handleMarkdown(TagElement node) {
843843
844844 List <ASTNode > fragments = node .fragments ();
845845 ArrayDeque <ASTNode > fragmentsDeque = new ArrayDeque <>(fragments );
846- handleMarkdownList (fragmentsDeque , 1 , 0 , null );
846+ handleMarkdownList (fragmentsDeque , this . markdownLeadingSpaces , 0 , null );
847847 handleMarkdownTable (fragments );
848848
849849 matcher = MARKDOWN_FENCES_PATTERN .matcher (text ); // Check for Markdown snippet with styles '``` & ```'
@@ -991,10 +991,10 @@ private boolean handleMarkdownIndentedCodeBlock(ArrayDeque<ASTNode> fragments, i
991991 firstTokenIndex ++;
992992 firstToken = this .ctm .get (firstTokenIndex );
993993 fragmentIndent = this .ctm .getLength (indentBase , firstToken .originalStart - 1 , 0 );
994- indentDiff = fragmentIndent - srcIndent ;
994+ indentDiff = fragmentIndent - srcIndent - 1 ; // somehow indent threshold is 1 higher in lists
995995 }
996996
997- if (indentDiff > 4 && (firstToken .getLineBreaksBefore () > 1 || isListItem )) {
997+ if (indentDiff >= 4 && (firstToken .getLineBreaksBefore () > 1 || isListItem )) {
998998 codeBlockStartIndex = firstTokenIndex ;
999999 firstToken .setAlign (this .markdownLeadingSpaces + fragmentIndent - 1 );
10001000 } else {
You can’t perform that action at this time.
0 commit comments