File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
- use brack_pdk_rs:: { metadata:: Metadata , values :: Value , types :: Type } ;
1
+ use brack_pdk_rs:: { metadata:: Metadata , types :: Type , values :: Value } ;
2
2
use extism_pdk:: { plugin_fn, FnResult , Json , WithReturnCode } ;
3
3
4
4
pub ( crate ) fn metadata_bold ( ) -> Metadata {
@@ -13,7 +13,7 @@ pub(crate) fn metadata_bold() -> Metadata {
13
13
#[ plugin_fn]
14
14
pub fn bold ( Json ( args) : Json < Vec < Value > > ) -> FnResult < String > {
15
15
if args. len ( ) != 1 {
16
- return Err ( WithReturnCode :: new ( anyhow:: anyhow!( "Usage: [* text]" ) , 1 ) ) ;
16
+ return Err ( WithReturnCode :: new ( anyhow:: anyhow!( "Usage: [std. * text]" ) , 1 ) ) ;
17
17
}
18
18
let text = match & args[ 0 ] {
19
19
Value :: Text ( t) => t,
@@ -24,5 +24,13 @@ pub fn bold(Json(args): Json<Vec<Value>>) -> FnResult<String> {
24
24
) )
25
25
}
26
26
} ;
27
- Ok ( format ! ( "<b>{}</b>" , text) )
27
+ Ok ( format ! (
28
+ "{{
29
+ \" t\" : \" Strong\" ,
30
+ \" c\" : [
31
+ {}
32
+ ]
33
+ }}," ,
34
+ text
35
+ ) )
28
36
}
You can’t perform that action at this time.
0 commit comments