Skip to content

v1.0.0-alpha.11

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Mar 21:28
5a878e9

Changes

  • Preserve indentation of trailing injection content in 5a878e9

    Tree-sitter's code_fence_content node for indented markdown fenced code
    blocks captures trailing indent spaces as part of the content range
    (e.g. \n ). When strip_leading_indent removed those spaces, the
    resulting bare newline was lost because trailing_newlines was computed
    from the original slice (which ended in spaces, not newlines). This
    caused the closing fence to collapse onto the last line of code.

    Add trailing_newlines_with_indent to look past exact-indent trailing
    spaces when detecting trailing newlines, and re-apply indent spaces
    after the final newline during recomposition so that subsequent content
    in the parent document stays at the correct column.