Skip to content

Commit

Permalink
bug fix, HTML atts for media nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
pml-lang committed Oct 25, 2022
1 parent 92f7f68 commit e9fd716
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ private static void writeElementStart (
@NotNull String CSSClass,
@Nullable String source,
@Nullable Integer width,

@Nullable Integer height,
@Nullable Boolean border,
@Nullable Map<String, String> extraAttributes,
Expand All @@ -173,19 +174,19 @@ private static void writeElementStart (
String clazz = CSSClass;
if ( border != null && border ) clazz = clazz + " " + FormalPMLNodeCreator.prefixedHTMLClassName ( "bordered" );

Map<String, String> nodeAttributes = new HashMap<>();
Map<String, String> nodeHTMLAttributes = node.getHTMLAttributes();
Map<String, String> HTMLAttributes = nodeHTMLAttributes != null ? new HashMap<> ( nodeHTMLAttributes ) : new HashMap<>();
if ( source != null ) {
nodeAttributes.put ( "src", source );
HTMLAttributes.put ( "src", source );
}
if ( width != null ) {
nodeAttributes.put ( "width", width.toString() );
HTMLAttributes.put ( "width", width.toString() );
}

if ( height != null ) {
nodeAttributes.put ( "height", height.toString() );
HTMLAttributes.put ( "height", height.toString() );
}

helper.writeHTMLStartTag ( tag, null, clazz, nodeAttributes, extraAttributes );
helper.writeHTMLStartTag ( tag, null, clazz, HTMLAttributes, extraAttributes );
}

private static void writeSource (
Expand Down

0 comments on commit e9fd716

Please sign in to comment.