File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
BootstrapBlazor.Server/Components/Components
BootstrapBlazor/Services/Serial Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export async function highlight(id) {
5555
5656 if ( el ) {
5757 const invoke = ( ) => {
58- hljs . highlightElement ( el . querySelector ( 'code' ) )
58+ hljs . highlightElement ( el . querySelector ( 'code' ) ) ;
5959 el . querySelector ( '.loading' ) . classList . add ( 'd-none' )
6060 el . classList . remove ( 'loaded' )
6161 }
@@ -64,6 +64,9 @@ export async function highlight(id) {
6464 const handler = setInterval ( ( ) => {
6565 const done = window . hljs !== void 0 ;
6666 if ( done ) {
67+ hljs . configure ( {
68+ ignoreUnescapedHTML : true
69+ } ) ;
6770 clearInterval ( handler )
6871 resolve ( )
6972 }
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ public DefaultSerialService(IJSRuntime jsRuntime)
2727
2828 private async Task < JSModule > LoadModule ( )
2929 {
30- var module = await _runtime . LoadModule ( "./_content/BootstrapBlazor/modules/serial.js" )
31- ?? throw new InvalidOperationException ( "Load serial module failed" ) ;
30+ var module = await _runtime . LoadModule ( "./_content/BootstrapBlazor/modules/serial.js" ) ;
3231
3332 IsSupport = await module . InvokeAsync < bool > ( "init" , _serialPortId ) ;
3433 return module ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ public class SerialServiceTest : BootstrapBlazorTestBase
99 [ Fact ]
1010 public async Task GetPort_Ok ( )
1111 {
12+ // https://itldg.github.io/web-serial-debug/?wt.mc_id=DT-MVP-5004174 网页串口调试工具
1213 Context . JSInterop . Setup < bool > ( "init" , matcher => matcher . Arguments . Count == 1 && ( matcher . Arguments [ 0 ] ? . ToString ( ) ? . StartsWith ( "bb_serial_" ) ?? false ) ) . SetResult ( true ) ;
1314 Context . JSInterop . Setup < bool > ( "getPort" , matcher => matcher . Arguments . Count == 1 && ( matcher . Arguments [ 0 ] ? . ToString ( ) ? . StartsWith ( "bb_serial_" ) ?? false ) ) . SetResult ( true ) ;
1415 Context . JSInterop . Setup < bool > ( "open" , matcher => matcher . Arguments . Count == 4 && ( matcher . Arguments [ 0 ] ? . ToString ( ) ? . StartsWith ( "bb_serial_" ) ?? false ) ) . SetResult ( true ) ;
You can’t perform that action at this time.
0 commit comments