-
Notifications
You must be signed in to change notification settings - Fork 1
1008030: To create integration for the Web Spell Checker with the Blazor Rich Text Editor. #7645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
krishnan-periyasamy
merged 17 commits into
hotfix/hotfix-v32.2.3
from
1008030-spellchecker-nhf
Feb 17, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7125335
1008030: To create integration for the Web Spell Checker with the Bla…
Bhuvaneshwari-SF4208 a355c21
Update web-spell-check.md
Bhuvaneshwari-SF4208 6388f66
Update web-spell-check.md
Bhuvaneshwari-SF4208 25b4f32
Update spell-checker.js
Bhuvaneshwari-SF4208 2106b7a
Fix variable naming and update JS function call
Bhuvaneshwari-SF4208 6c437f5
Update web-spell-check.md
Bhuvaneshwari-SF4208 6d417c2
Merge branch 'hotfix/hotfix-v32.2.3' into 1008030-spellchecker-nhf
Bhuvaneshwari-SF4208 0e41f1c
1008030: added hyperlink for wproofreader.
KokilaSF4836 279bda6
1008030: reverted hyperlink for wproofreader.
KokilaSF4836 ec29fd0
1008030: To create integration for the Web Spell Checker with the Bla…
krishnan-periyasamy c34934e
1008030: Resolved casing issue
KokilaSF4836 0a4e57f
1008030: updated toc file.
KokilaSF4836 26d9500
1008006: Added github location
KokilaSF4836 4778f92
Merge branch 'hotfix/hotfix-v32.2.3' into 1008030-spellchecker-nhf
Bhuvaneshwari-SF4208 8d0d123
Add Code Mirror link and retain Web Spell Checker
Bhuvaneshwari-SF4208 be198ec
Update blazor-toc.html
Bhuvaneshwari-SF4208 c1ed568
Update web-spell-check.md
Bhuvaneshwari-SF4208 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| window.initializeWebSpellChecker = function (sfId) { | ||
| if (!window.sfBlazor || !sfBlazor.instances) { | ||
| console.warn('sfBlazor not available'); | ||
| return; | ||
| } | ||
|
|
||
| const editor = sfBlazor.instances[sfId]; | ||
| if (!editor) { | ||
| console.warn('Editor instance not found for ID:', sfId); | ||
| return; | ||
| } | ||
|
|
||
| const rteContainer = editor.element | ||
| ? editor.element.querySelector('.e-rte-container') | ||
| : null; | ||
|
|
||
| if (!rteContainer) { | ||
| console.warn('RTE container not found'); | ||
| return; | ||
| } | ||
| window.WEBSPELLCHECKER_CONFIG = { | ||
| // Replace with your activation key from your registered account | ||
| serviceId: 'Your activation key', | ||
| autoSearch: true, | ||
| lang: 'en_US', | ||
| selectors: [ | ||
| { selector: rteContainer } | ||
| ], | ||
| // Optional: | ||
| // theme: 'gray', | ||
| }; | ||
| const tryInitialize = () => { | ||
| if (window.WEBSPELLCHECKER && typeof window.WEBSPELLCHECKER.startAutoSearch === 'function') { | ||
| window.WEBSPELLCHECKER.startAutoSearch(); | ||
| console.log('WProofreader initialized successfully'); | ||
| } else { | ||
| console.log('WProofreader not ready yet — retrying...'); | ||
| setTimeout(tryInitialize, 300); | ||
| } | ||
| }; | ||
|
|
||
| tryInitialize(); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| @page "/spell-checker" | ||
|
|
||
| @using Syncfusion.Blazor.RichTextEditor | ||
| @inject IJSRuntime JS | ||
|
|
||
| <SfRichTextEditor ID="@rteId" @ref="rte" Value="@initialHtml"> | ||
| <RichTextEditorEvents Created="@Created"></RichTextEditorEvents> | ||
| </SfRichTextEditor> | ||
|
|
||
| @code { | ||
| private SfRichTextEditor? rte; | ||
| private string rteId { get; } = "sfrichtexteditor"; | ||
| private string initialHtml = @"<p>Enter your text here with real spelling and grammar mistakes to see how WProofreader works. A lot of potential errors will be underlined; hover on the marked words for instant correction suggestions.</p>"; | ||
|
|
||
| private async Task Created() | ||
| { | ||
| var id = rte?.ID ?? rteId; | ||
| await JS.InvokeVoidAsync("initializeWebSpellChecker", id); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| layout: post | ||
| title: Spell Checker in Blazor RichTextEditor Component | Syncfusion | ||
| description: Learn how to integrate WProofreader spell-checking support into the Syncfusion Blazor Rich Text Editor, including setup steps, package installation, and usage. | ||
| platform: Blazor | ||
| control: RichTextEditor | ||
| documentation: ug | ||
| --- | ||
|
|
||
| # Integrate Spell Checker into the Blazor Rich Text Editor Component | ||
|
|
||
| WProofreader enables real-time spelling, grammar, and style checks inside the Rich Text Editor editable area. The SDK attaches to the editor content element and provides suggestions without changing the editor workflow. | ||
|
|
||
| ## Key features | ||
|
|
||
| - Real-time spelling and grammar suggestions. | ||
| - Multilingual support and custom dictionaries. | ||
| - Cloud and on-premise deployment options. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before proceeding, ensure you have completed the basic Rich Text Editor setup as outlined in the Getting Started guide. This includes configuring the Blazor project, installing the required packages, importing the necessary CSS files, injecting the modules, and adding the basic editor markup. | ||
|
|
||
| Refer to the guide here: [Getting Started with Blazor Rich Text Editor](https://blazor.syncfusion.com/documentation/rich-text-editor/getting-started-with-server-app). | ||
|
|
||
|
KokilaSF4836 marked this conversation as resolved.
|
||
| ## Step 1: Set up the WProofreader SDK | ||
|
|
||
| For integrating the Spell Checker you need to install the below NPM package: | ||
|
|
||
| ```bash | ||
| npm install @webspellchecker/wproofreader-sdk-js | ||
| ``` | ||
|
|
||
| > **Note:** Register for a [Web Spell Checker](https://wproofreader.com/sdk) cloud service key and ensure that the `serviceId` is available. | ||
| > For self‑hosted deployments, make sure the service endpoint settings are properly configured. | ||
|
|
||
| ## Step 2: Add the JavaScript Interop File | ||
|
|
||
| Create the JavaScript interop module to handle communication between Blazor and Spell Checker. | ||
|
|
||
| ### 2.1 Create the interop file | ||
|
|
||
| In your Blazor project, create a new folder named `wwwroot/scripts/` and add a file called `spell-checker.js` to include the code shown below, | ||
|
|
||
|
KokilaSF4836 marked this conversation as resolved.
|
||
| {% tabs %} | ||
| {% highlight javascript %} | ||
|
|
||
| {% include_relative code-snippet/spell-checker.js %} | ||
|
|
||
| {% endhighlight %} | ||
| {% endtabs %} | ||
|
|
||
| ### 2.2 Verify file placement | ||
|
|
||
| Ensure the file is located at: | ||
|
|
||
| ``` | ||
| YourProject/ | ||
| └── wwwroot/ | ||
| └── scripts/ | ||
| └── spell-checker.js | ||
| ``` | ||
|
|
||
| ## Step 3: Add Script Reference in Host Page | ||
|
|
||
| Add the script references in your host page before the closing `</body>` tag: | ||
|
|
||
| ```html | ||
| <body> | ||
| .... | ||
| <!-- Syncfusion CSS and Script references --> | ||
| <script src="https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js"></script> | ||
| <script src="/scripts/spell-checker.js"></script> | ||
| </body> | ||
| ``` | ||
|
|
||
| > The host page location varies by project type. Refer to the [Rich Text Editor Getting Started](https://blazor.syncfusion.com/documentation/rich-text-editor/getting-started) guide for the correct host page file path. | ||
| > | ||
| > **Note:** The Spell Checker script must be loaded before the custom interop file to ensure proper functionality. | ||
|
|
||
| ## Step 4: Create the Razor Component | ||
|
|
||
| Create a new Razor component file named **`RichTextEditorWithSpellChecker.razor`** in your **Pages** directory: | ||
|
|
||
| {% tabs %} | ||
| {% highlight cshtml %} | ||
|
|
||
| {% include_relative code-snippet/spell-checker.razor %} | ||
|
|
||
| {% endhighlight %} | ||
| {% endtabs %} | ||
|
|
||
| ## Additional resources | ||
|
|
||
| - WProofreader SDK: https://www.npmjs.com/package/@webspellchecker/wproofreader-sdk-js | ||
|
|
||
| ## See also | ||
|
|
||
| * [GitHub Example - Blazor Rich Text Editor with Web Spell Checker](https://github.com/SyncfusionExamples/blazor-richtexteditor-webspellchecker) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.