Skip to content

Commit

Permalink
fix sink tag
Browse files Browse the repository at this point in the history
  • Loading branch information
DM committed Oct 20, 2024
1 parent f60cfc0 commit 381312a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ export function rml(strings: TemplateStringsArray, ...expressions: RMLTemplateEx
if(attributeName == 'style') {
const CSSAttribute = /;?(?<key>[a-z][a-z0-9\-_]*)\s*:\s*$/.exec(string)?.groups?.key;
sink = CSSAttribute ? StylePreSink(CSSAttribute): StyleObjectSink;
handler = PreSink<HTMLElement | SVGElement>(sink, expression, CSSAttribute);
handler = PreSink<HTMLElement | SVGElement>('StyleObject', sink, expression, CSSAttribute);
} else {
isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attributeName);
sink = (sinkByAttributeName.get(attributeName) ?? (isBooleanAttribute && DOMAttributePreSink(<WritableElementAttribute>attributeName))) || FixedAttributePreSink(attributeName);
handler = PreSink(sink, expression, attributeName);
handler = PreSink(attributeName, sink, expression, attributeName);
}

// addRef(ref, <RMLTemplateExpressions.GenericHandler>{ handler: expression, type: attributeType, attribute: attributeName });
Expand Down
14 changes: 7 additions & 7 deletions src/sinks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import { RMLTemplateExpressions, SinkBindingConfiguration } from "../types/inter
// data,
// });

export const PreSink = <T extends Element>(sink: Sink<T>, source: RMLTemplateExpressions.Any, args: any) =>
<SinkBindingConfiguration<T>>({
type: 'sink',
t: 'GenericSink',
source,
sink,
})
export const PreSink = <T extends Element>
(tag: string, sink: Sink<T>, source: RMLTemplateExpressions.Any, args: any) => ({
type: 'sink',
t: tag,
source,
sink,
}) as SinkBindingConfiguration<T>
;

//export { AnyContentSink } from "./content-sink";
Expand Down

0 comments on commit 381312a

Please sign in to comment.