Skip to content

Providing a language doesn't disable autodetect #41

@barrycohen

Description

@barrycohen

The following does not use shell highlighting:

<highlightjs language="shell" code="#include <iostream>"></highlightjs>

Instead, it autodetects cpp and uses that, even though "shell" was explicitly provided. It is possible to force autodetect off but I don't think that's supposed to be required:

<highlightjs :autodetect="false" language="shell" code="#include <iostream>"></highlightjs>

See this fiddle https://jsfiddle.net/5nvhra3p/ for a live example.

I think there's a logic error in vue.ts:

const autodetect = computed(() => props.autodetect || !language.value)

I think this should be:

const autodetect = computed(() => props.autodetect && !language.value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions