SCEditor | A lightweight HTML and BBCode WYSIWYG editor | Editor library
kandi X-RAY | SCEditor Summary
kandi X-RAY | SCEditor Summary
A lightweight WYSIWYG BBCode and XHTML editor. For more information visit sceditor.com.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- BBCodeParser object .
- Initialize a new XHTML format .
- Initialize BBCode formats .
- Parse tokens to array
- Normalizes newlines into tokens .
- Convert a bplate code into a list .
- Convert tokens into HTML .
- Removes white space from a root node .
- Merge inline style nodes .
- Removes all tags from a root node .
SCEditor Key Features
SCEditor Examples and Code Snippets
Community Discussions
Trending Discussions on SCEditor
QUESTION
I want to use SCEditor in my Blazor page.
For example I create a new Blazor WASM project and I did these steps:
According to documentation I add this codes and references to
...index.html
:
ANSWER
Answered 2022-Jan-20 at 12:08Blazor documentation warns:
Only mutate the Document Object Model (DOM) with JavaScript (JS) when the object doesn't interact with Blazor. Blazor maintains representations of the DOM and interacts directly with DOM objects. If an element rendered by Blazor is modified externally using JS directly or via JS Interop, the DOM may no longer match Blazor's internal representation, which can result in undefined behavior. Undefined behavior may merely interfere with the presentation of elements or their functions but may also introduce security risks to the app or server.
This guidance not only applies to your own JS interop code but also to any JS libraries that the app uses, including anything provided by a third-party framework, such as Bootstrap JS and jQuery.
SCEditor is exactly one of those DOM-mutating libraries, and the effects of failure to observe that guidance you can see for yourself. (The ‘security risks’ bit is rather nonsensical: if your app can be made insecure merely by modifying client-side code, then it wasn’t very secure to begin with. But it’s otherwise good advice.)
Blazor does provide some interoperability with external DOM mutation in the form of element references. The documentation again warns:
Only use an element reference to mutate the contents of an empty element that doesn't interact with Blazor. This scenario is useful when a third-party API supplies content to the element. Because Blazor doesn't interact with the element, there's no possibility of a conflict between Blazor's representation of the element and the Document Object Model (DOM).
Heeding that warning, you should probably write something like below (not tested). In the component file (.razor
):
QUESTION
How can SCEditor be forced to start with Arial as its default font when it is empty? The default appears to be a Serif font - perhaps Times.
...ANSWER
Answered 2021-Oct-10 at 23:49The default style of WYSIWYG content is the browsers default style.
It can be changed by setting the style
option in the constructor. It's recommended to use (or base your style on) the content/default.min.css
style as it contains some other important CSS.
Something like:
QUESTION
I am inserting text into an instance of SCeditor and would like to move the cursor after the insert, to a specific position within the inserted text.
Code of the SCeditor init:
...ANSWER
Answered 2021-Sep-26 at 13:12You'll need to use Range.setStart()
with a custom offset.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SCEditor
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page