/*
 * Copyright (c) 2018, 2025, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULE_NAME="oj-html-tag-attr-noprefix";const DESCRIPT="On a common HTML element (i.e. is not a custom element), any use of an attribute "+"not prefixed with ':' and with an expression (e.g. attr=\"[[...]]\" or attr=\"{{...}}\"), is invalid.";const SHORT="Global HTML elements with an attribute expression with no ':' prefix are invalid";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return DESCRIPT}function register(){return{"globtag":_onTag}};function _onTag(context,tagName){var attribs,attrib,attrValue;if(!(attribs=context.node.attribs));for(attrib in attribs){if(attrib==="data-oj-context"||attrib==="data-oj-command"){continue}if(attrib.charAt(0)!==":"&&!attrib.startsWith("on-")){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){let issue=new context.Issue(`Expression-bound attribute without ':' prefix '${attrib}' found on global elem <${tagName}> - use ':${attrib}'`);let attrPos=context.utils.DomUtils.getAttribPosition(context.data,context.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};