Skip to content

Commit 4b6f7e5

Browse files
committed
fix(web): properly render Suggestion::InsertAfter in the editor
1 parent 29983db commit 4b6f7e5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

demo.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Harper is an language checker for developers. it can detect
55
improper capitalization and misspellled words,
66
as well as a number of other issues.
77
Like if you break up words you shoul dn't.
8+
Harper can be a lifesaver when writing technical documents,
9+
emails or other formal forms of communication.
810

911
Harper works everywhere, even offline. Since you r data
1012
never leaves your device, you don't ned to worry aout us

packages/web/src/lib/Editor.svelte

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@
104104
>
105105
{#if suggestion.kind() == SuggestionKind.Remove}
106106
Remove "{lint.get_problem_text()}"
107-
{:else}
107+
{:else if suggestion.kind() == SuggestionKind.Replace}
108108
Replace "{lint.get_problem_text()}" with "{suggestion.get_replacement_text()}"
109+
{:else}
110+
Insert "{suggestion.get_replacement_text()}" after "{lint.get_problem_text()}"
109111
{/if}
110112
</Button>
111113
</div>

0 commit comments

Comments
 (0)