Moved BindingGenerator from gen html project. It makes more sense here.
This commit is contained in:
80
Sources/BindingGenerator/Generated/Elements/Embed.swift
Normal file
80
Sources/BindingGenerator/Generated/Elements/Embed.swift
Normal file
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// Embed.swift
|
||||
// HTMLStandard
|
||||
//
|
||||
// Generated on 09/23/2025.
|
||||
// THIS FILE IS GENERATED. DO NOT EDIT.
|
||||
//
|
||||
import Foundation
|
||||
|
||||
/// <embed> Plugin
|
||||
public class Embed : HTMLNode, IEmbedded, IFlow, IInteractive, IPalpable, IPhrasing {
|
||||
|
||||
/// Vertical dimension. Valid non-negative integer.
|
||||
public var height:UInt? = nil
|
||||
|
||||
/// Address of the resource. Valid non-empty URL potentially surrounded by spaces.
|
||||
public var src:URL? = nil
|
||||
|
||||
/// Type of embedded resource. Valid MIME type string.
|
||||
public var type:String? = nil
|
||||
|
||||
/// Horizontal dimension. Valid non-negative integer.
|
||||
public var width:UInt? = nil
|
||||
|
||||
|
||||
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
|
||||
var globalAttr = GlobalAttributesBuilder()
|
||||
for (key, attValue) in attributes {
|
||||
switch (key) {
|
||||
case "height":
|
||||
height = UInt(attValue)
|
||||
continue
|
||||
case "src":
|
||||
src = try URL(expect: attValue)
|
||||
continue
|
||||
case "type":
|
||||
type = attValue
|
||||
continue
|
||||
case "width":
|
||||
width = UInt(attValue)
|
||||
continue
|
||||
|
||||
default: break
|
||||
}
|
||||
if globalAttr.trySetGlobalAttribute(key, attValue) {
|
||||
continue
|
||||
}
|
||||
continue
|
||||
}
|
||||
super.init(globalAttr)
|
||||
}
|
||||
|
||||
|
||||
public override func renderAttributes() -> String {
|
||||
var result = super.renderAttributes()
|
||||
if let height = height {
|
||||
result += " height='\(height)'"
|
||||
}
|
||||
if let src = src {
|
||||
result += " src='\(src.absoluteString)'"
|
||||
}
|
||||
if let type = type {
|
||||
result += " type='\(type)'"
|
||||
}
|
||||
if let width = width {
|
||||
result += " width='\(width)'"
|
||||
}
|
||||
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
override var nodeName: String {
|
||||
return "embed"
|
||||
}
|
||||
|
||||
override var isVoidElement: Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user