File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/taro-runtime/src/dom-external/inner-html Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,22 @@ function hasTerminalParent (tagName: string, stack: Element[]) {
7171 return false
7272}
7373
74- function getTagName ( tag : string ) {
74+ function getTagName ( tag : string , attributes : string [ ] ) {
7575 if ( options . html ! . renderHTMLTag ) {
7676 return tag
7777 }
7878
7979 if ( specialMiniElements [ tag ] ) {
8080 return specialMiniElements [ tag ]
8181 } else if ( isMiniElements ( tag ) ) {
82+ if ( isBlockElements ( tag ) ) {
83+ return attributes . includes ( 'skyline-mode' ) ? tag : 'view'
84+ }
85+
86+ if ( isInlineElements ( tag ) ) {
87+ return attributes . includes ( 'skyline-mode' ) ? tag : 'text'
88+ }
89+
8290 return tag
8391 } else if ( isBlockElements ( tag ) ) {
8492 return 'view'
@@ -128,7 +136,7 @@ function format (
128136 return text
129137 }
130138
131- const el : ParsedTaroElement = document . createElement ( getTagName ( child . tagName ) )
139+ const el : ParsedTaroElement = document . createElement ( getTagName ( child . tagName , child . attributes ) )
132140 el . h5tagName = child . tagName
133141
134142 parent ?. appendChild ( el )
You can’t perform that action at this time.
0 commit comments