jelovirt / org.lwdita

LwDITA parser for DITA-OT
http://lwdita.org/
Apache License 2.0
25 stars 19 forks source link

Allow Admonition variant types to be case insensitive #227

Closed michael-nok closed 1 month ago

michael-nok commented 3 months ago

When specifying an Admonition note, the variant type must be specified in lowercase.

This causes some confusion given the output of the variant may have an uppercase starting letter.

File: CoreNodeRenderer.java - Line 405

Please consider changing:

final String type = node.getInfo().toString();

to:

final String type = node.getInfo().toString().toLower();

switch statement:

        switch (type) {
            case "note":
            case "tip":
            case "fastpath":
            case "restriction":
            case "important":
            case "remember":
            case "attention":
            case "caution":
            case "notice":
            case "danger":
            case "warning":
            case "trouble":
                atts.add("type", type);
                break;
            default:
                atts.add("type", "other").add("othertype", type);
                break;
        }