File tree Expand file tree Collapse file tree 3 files changed +6
-25
lines changed
Expand file tree Collapse file tree 3 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -19,19 +19,15 @@ export class ButtonHandlers implements IWidgetHandler<ButtonModel> {
1919 openWidgetEditorCommand ( context , "Edit button" ) ,
2020 splitter ( ) ,
2121 switchToParentCommand ( context ) ,
22+ // openHelpArticleCommand(context, "/widgets/button")
2223 ] ;
2324
2425 if ( visibilityCommand ) {
2526 selectCommands . push ( visibilityCommand ) ;
2627 }
2728
2829 const contextualEditor : IContextCommandSet = {
29- selectCommands : [
30- openWidgetEditorCommand ( context , "Edit button" ) ,
31- splitter ( ) ,
32- switchToParentCommand ( context ) ,
33- // openHelpArticleCommand(context, "/widgets/button")
34- ] ,
30+ selectCommands : selectCommands ,
3531 deleteCommand : deleteWidgetCommand ( context )
3632 } ;
3733
Original file line number Diff line number Diff line change 11import * as ko from "knockout" ;
22import { HyperlinkModel } from "@paperbits/common/permalinks" ;
3- import { HyperlinkBehavior } from "@paperbits/common/behaviors/hyperlinkBehavior " ;
3+ import { HyperlinkBehavior } from "@paperbits/common/behaviors/behavior.hyperlink " ;
44
55ko . bindingHandlers [ "hyperlink" ] = {
66 update ( element : HTMLElement , valueAccessor : ( ) => HyperlinkModel ) : void {
Original file line number Diff line number Diff line change 11import * as ko from "knockout" ;
2- import { remark } from "remark" ;
3- import remarkParse from "remark-parse" ;
4- import remarkGfm from "remark-gfm" ;
5- import remarkRehype from "remark-rehype" ;
6- import rehypeRaw from "rehype-raw" ;
7- import rehypeStringify from "rehype-stringify" ;
2+ import { MarkdownBehavior } from "@paperbits/common/behaviors/bahavior.markdown" ;
83
94ko . bindingHandlers [ "markdown" ] = {
105 update : async ( element : HTMLElement , valueAccessor : ( ) => string ) : Promise < void > => {
116 const markdown = ko . unwrap ( valueAccessor ( ) ) ;
12- const htmlObservable = ko . observable ( ) ;
7+ const behavior = new MarkdownBehavior ( ) ;
138
14- const html = await remark ( )
15- . use ( remarkParse )
16- . use ( remarkGfm )
17- . use ( remarkRehype , { allowDangerousHtml : true } )
18- . use ( rehypeRaw )
19- . use ( rehypeStringify )
20- . process ( markdown ) ;
21-
22- ko . applyBindingsToNode ( element , { html : htmlObservable } , null ) ;
23-
24- htmlObservable ( html ) ;
9+ behavior . attach ( element , markdown ) ;
2510 }
2611} ;
You can’t perform that action at this time.
0 commit comments