Skip to content

Commit

Permalink
fix(folding): section folding range
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Nov 29, 2024
1 parent 3ba4539 commit 2c727ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
**Fixed**

- Detection of `<ref>` definitions with non-empty content
- Folding range for sections
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-extension-wikiparser",
"version": "1.0.1",
"version": "1.0.2",
"description": "Language server extension for MediaWiki Wikitext that supports linting, autocomplete, and more.",
"displayName": "WikiParser Language Server",
"categories": [
Expand Down
2 changes: 1 addition & 1 deletion server/src/folding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function provide(
for (const token of tokens) {
const index = token.getAbsoluteIndex(),
{top} = root.posFromIndex(index)!,
lines = String(token).replace(/\n$/u, '').split('\n');
lines = String(token).replace(/(?<!\n)\n+$/u, '').split('\n');
if (token.type === 'heading') {
const {level, firstChild} = token;
if (symbol) {
Expand Down

0 comments on commit 2c727ce

Please sign in to comment.