Skip to content

Commit

Permalink
Ignore case sensitive directive and interpreted text roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinovantes committed Jul 2, 2024
1 parent ef91832 commit ff6e256
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Generator/RstGeneratorState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class RstGeneratorState implements SimpleNameResolverProxy {
const handleNode = () => {
switch (true) {
case node instanceof RstInterpretedText: {
const generator = this._compiler.interpretedTextGenerators.get(node.role)
const generator = this._compiler.interpretedTextGenerators.get(node.role.toLowerCase())
if (!generator) {
throw new RstGeneratorError(this, node, 'Missing generator')
}
Expand All @@ -324,7 +324,7 @@ export class RstGeneratorState implements SimpleNameResolverProxy {
}

case node instanceof RstDirective: {
const generator = this._compiler.directiveGenerators.get(node.directive)
const generator = this._compiler.directiveGenerators.get(node.directive.toLowerCase())
if (!generator) {
throw new RstGeneratorError(this, node, 'Missing generator')
}
Expand Down
4 changes: 2 additions & 2 deletions src/RstCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export class RstCompiler {

useDirectiveGenerator(generator: RstDirectiveGenerator) {
for (const directive of generator.directives) {
this.directiveGenerators.set(directive, generator)
this.directiveGenerators.set(directive.toLowerCase(), generator)
}
}

useInterpretedTextGenerator(generator: RstInterpretedTextGenerator) {
for (const role of generator.roles) {
this.interpretedTextGenerators.set(role, generator)
this.interpretedTextGenerators.set(role.toLowerCase(), generator)
}
}

Expand Down

0 comments on commit ff6e256

Please sign in to comment.