# Disable an injection into HTML from another plugin

**URL:** <https://platform.jetbrains.com/t/disable-an-injection-into-html-from-another-plugin/1231>\
**Category:** IntelliJ Platform\
**Tags:** language-injection\
**Created:** [April 4, 2025, 11:13am UTC](https://platform.jetbrains.com/t/disable-an-injection-into-html-from-another-plugin/1231 "2025-04-04T11:13:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Jarrett.oell](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Simon\_Jarrett.oell](https://platform.jetbrains.com/u/Simon_Jarrett.oell)\
**Post date:** [April 4, 2025, 11:13am UTC](https://platform.jetbrains.com/t/disable-an-injection-into-html-from-another-plugin/1231/1 "2025-04-04T11:13:08Z")

</div>

I have a custom language that is an extension of HTML. One of the features is to allow the injection of ruby code in HTML attributes beginning with “:” for certain tags, e.g.:

```auto
<x-abc :title="this is ruby code"/>

```

However, currently the default Vue plugin is injecting JavaScript into these attributes.

1. How can I disable the Vue injection? Preferably just for certain tags.
2. Is there an easy way to add an injection into XML attributes without needing a lexer?
3. Is it possible to re-enable the Vue injection if there are two colons, `::`?

I’ve been looking into extension points, but I’ve only found names, and no descriptions of what they do.

---

<div class="post-metadata">

**Author:** ![Simon\_Jarrett.oell](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Simon\_Jarrett.oell](https://platform.jetbrains.com/u/Simon_Jarrett.oell)\
**Post date:** [April 4, 2025, 11:56am UTC](https://platform.jetbrains.com/t/disable-an-injection-into-html-from-another-plugin/1231/2 "2025-04-04T11:56:06Z")

</div>

Asked ChatGPT and it gave the answer immediately!

I wrote a MultiHostIniector to inject Ruby into those attributes:

```auto
class MyRubyAttributeInjector : MultiHostInjector {
    override fun getLanguagesToInject(registrar: MultiHostRegistrar, context: PsiElement) {
        if (context is XmlAttributeValue) {
            val parent = context.parent as? XmlAttribute ?: return
            val tag = parent.parent as? XmlTag ?: return
            if (tag.name == "x-abc" && parent.name.startsWith(":") && !parent.name.startsWith("::")) {
                registrar.startInjecting(RubyLanguage.INSTANCE)
                    .addPlace(null, null, context, TextRange(1, context.textLength - 1))
                    .doneInjecting()
            }
        }
    }

    override fun elementsToInjectIn() = listOf(XmlAttributeValue::class.java)
}

```

And added it to my plugin with order set to first to prevent Vue injecting:

```auto
<extension point="com.intellij.multiHostInjector">
  <multiHostInjector implementation="your.package.MyRubyAttributeInjector" order="first"/>
</extension>

```

---

<div class="post-metadata">

**Author:** ![Simon\_Jarrett.oell](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Simon\_Jarrett.oell](https://platform.jetbrains.com/u/Simon_Jarrett.oell)\
**Post date:** [April 4, 2025, 12:31pm UTC](https://platform.jetbrains.com/t/disable-an-injection-into-html-from-another-plugin/1231/3 "2025-04-04T12:31:49Z")

</div>

More specifically, this change:

> <https://github.com/mwnciau/rblade-intellij/commit/a26c69746299cd5e908131f4e07e924fee6b0ea6>
