This repository was archived by the owner on Dec 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,18 @@ Negative
9292: This will appear in a negative info box.
9393```
9494
95+ ` <aside> ` elements work as well:
96+
97+ ```
98+ <aside class="positive">
99+ This will appear in a positive info box.
100+ </aside>
101+
102+ <aside class="negative">
103+ This will appear in a negative info box.
104+ </aside>
105+ ```
106+
95107#### Download Buttons
96108
97109Codelabs sometimes contain links to SDKs or sample code. The codelab renderer
Original file line number Diff line number Diff line change @@ -92,6 +92,10 @@ func isButton(hn *html.Node) bool {
9292 return hn .DataAtom == atom .Button
9393}
9494
95+ func isAside (hn * html.Node ) bool {
96+ return hn .DataAtom == atom .Aside
97+ }
98+
9599func isInfobox (hn * html.Node ) bool {
96100 if hn .DataAtom != atom .Dt {
97101 return false
Original file line number Diff line number Diff line change @@ -354,6 +354,8 @@ func parseNode(ds *docState) (types.Node, bool) {
354354 return code (ds , true ), true
355355 case isCode (ds .cur ):
356356 return code (ds , false ), true
357+ case isAside (ds .cur ):
358+ return aside (ds ), true
357359 case isInfobox (ds .cur ):
358360 return infobox (ds ), true
359361 case isSurvey (ds .cur ):
@@ -535,6 +537,27 @@ func header(ds *docState) types.Node {
535537 return n
536538}
537539
540+ // aside produces an infobox.
541+ func aside (ds * docState ) types.Node {
542+ kind := types .InfoboxPositive
543+ for _ , v := range ds .cur .Attr {
544+ // If class "negative" is given, set the infobox type.
545+ if v .Key == "class" && v .Val == "negative" {
546+ kind = types .InfoboxNegative
547+ }
548+ }
549+
550+ ds .push (nil )
551+ nn := parseSubtree (ds )
552+ nn = blockNodes (nn )
553+ nn = compactNodes (nn )
554+ ds .pop ()
555+ if len (nn ) == 0 {
556+ return nil
557+ }
558+ return types .NewInfoboxNode (kind , nn ... )
559+ }
560+
538561// infobox doesn't have a block parent.
539562func infobox (ds * docState ) types.Node {
540563 negativeInfoBox := isInfoboxNegative (ds .cur )
You can’t perform that action at this time.
0 commit comments