Skip to content

Commit

Permalink
Merge branch 'master' into depfu/batch_all/npm/2024-06-26
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerCodeMonkey authored Jul 15, 2024
2 parents 1e49ff1 + a36667f commit 9960807
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,15 @@ As a helper `ngx-quill` provides a component where you can pass many options of
<quill-view [content]="content" format="text" theme="snow"></quill-view>
```

### QuillViewHTMLComponent - Using angular [innerHTML]
### QuillViewHTMLComponent - Using angular [innerHTML] (DEPRECATED with quill v2)

Most of you will use the `html` format (even it is not recommended). To render custom html with angular you should use the `[innerHTML]` attribute.

But there are some pitfalls:

1. You need to have the quill css files loaded, when using classes and not inline styling (https://quilljs.com/guides/how-to-customize-quill/#class-vs-inline)
2. When using classes use a `div`-tag that has the `innerHTML` attribute and add the `ql-editor` class. Wrap your div in another `div`-tag with css classes `ql-container` and your theme, e.g. `ql-snow`.:
3. With quill v2 ngx-quill is using `quill.getSemanticHTML()` to get html content. There some list tag information are stripped. (https://github.com/slab/quill/issues/4103) (https://github.com/KillerCodeMonkey/ngx-quill/issues/1888)

```HTML
<div class="ql-container ql-snow" style="border-width: 0;">
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-quill",
"version": "26.0.4",
"version": "26.0.5",
"license": "MIT",
"author": {
"name": "Bengt Weiße"
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/src/lib/quill-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export abstract class QuillEditorBase implements AfterViewInit, ControlValueAcce
readonly required = input(false)
readonly formats = input<string[] | null | undefined>(undefined)
readonly customToolbarPosition = input<'top' | 'bottom'>('top')
readonly sanitize = input<boolean | undefined>(false)
readonly sanitize = input<boolean | undefined>(undefined)
readonly beforeRender = input<() => Promise<void> | undefined>(undefined)
readonly styles = input<any>(null)
readonly registry = input<QuillOptions['registry']>(
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/src/lib/quill-view-html.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { NgClass } from '@angular/common'
export class QuillViewHTMLComponent implements OnChanges {
readonly content = input('')
readonly theme = input<string | undefined>(undefined)
readonly sanitize = input<boolean | undefined>(false)
readonly sanitize = input<boolean | undefined>(undefined)

readonly innerHTML = signal<SafeHtml>('')
readonly themeClass = signal('ql-snow')
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/src/lib/quill-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class QuillViewComponent implements AfterViewInit, OnChanges, OnDestroy {
readonly modules = input<QuillModules | undefined>(undefined)
readonly debug = input<'warn' | 'log' | 'error' | false>(false)
readonly formats = input<string[] | null | undefined>(undefined)
readonly sanitize = input<boolean | undefined>(false)
readonly sanitize = input<boolean | undefined>(undefined)
readonly beforeRender = input<() => Promise<void> | undefined>(undefined)
readonly strict = input(true)
readonly content = input<any>()
Expand Down

0 comments on commit 9960807

Please sign in to comment.