File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
main/resources/META-INF/resources/frontend
test/java/com/flowingcode/vaadin/addons/demo Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,10 @@ pre[class*="language-"] {
244244 }
245245
246246 cleanupCode ( text : string ) : string {
247- return text . split ( '\n' ) . filter ( line =>
247+ return text . split ( '\n' ) . map ( line => {
248+ let m = line ! . match ( "^(?<spaces>\\s*)//\\s*show-source\\s(?<line>.*)" ) ;
249+ return m ?m . groups ! . spaces + m . groups ! . line : line ! ;
250+ } ) . filter ( line =>
248251 ! line . match ( "//\\s*hide-source(\\s|$)" )
249252 && ! line . startsWith ( '@Route' )
250253 && ! line . startsWith ( '@PageTitle' )
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public class SampleDemoDefault extends Div {
3131
3232 public SampleDemoDefault () {
3333 add (new Span ("Demo component with defaulted @DemoSource annotation" ));
34+ // show-source System.out.println("this line will be displayed in the code snippet");
3435 this .getClass (); // hide-source (this line will not be displayed in the code snippet)
3536 }
3637}
You can’t perform that action at this time.
0 commit comments