renderScriptAttributes method

String renderScriptAttributes()

Render attached script to HTML attributes

Implementation

String renderScriptAttributes() {
  final attrs = <String>['id="$id"']; // ✅ Always include ID

  if (script != null) {
    final data = script!.toJson();
    data.forEach((key, value) {
      attrs.add('data-flint-$key=\'${_encodeJson(value)}\'');
    });
  }

  return attrs.join(' ');
}