You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... the problem doesn't occur with the mkdocs or readthedocs themes
... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
... the documentation does not mention anything about my problem
... there are no open or closed issues that are related to my problem
Description
I tried to use Code Annotations with Terraform syntax highlighting as the following:
index.md
# Problem 1
``` terraform
terraform { # (1)
required_version = ">= 1.1.0"
}
provider "azurerm" { # (2)
features {}
}
```
1. Hello World 1
2. Hello World 2
# Problem 2
``` terraform
terraform { # (1)
required_version = ">= 1.1.0"
}
provider "azurerm" {
features {}
}
# (2)
module "hello_world" {
source "../.."
foo = "bar"
}
```
1. Hello World 1
2. Hello World 2
Expected behaviour
Code Annotations should render correctly for both code blocks.
Actual behaviour
HTLM output looks like this:
Problem 1
It looks like # (2) is not treated as a comment. At least it isn't highlighted the same way as the other comment.
Problem 2
Browser is throwing the following exception:
index.ts:77 Uncaught TypeError: Cannot read properties of null (reading 'textContent')
at cs (index.ts:77:43)
at Zo (index.ts:120:24)
at index.ts:193:30
at e._subscribe (defer.ts:55:15)
at e._trySubscribe (Observable.ts:245:19)
at Observable.ts:235:18
at nt (errorContext.ts:29:5)
at e.subscribe (Observable.ts:221:5)
at switchMap.ts:109:49
at t.s._next (OperatorSubscriber.ts:70:13)
It seems like that there are empty c/c1/cm elements in code block which force this exception. Further, for any other code block after this one, annotations don't get rendered at all.
Steps to reproduce
Create project with mkdocs.yaml and index.md as provided
This seems to be an issue with the Pygments Terraform lexer, as the second comment is a syntax error, and not correctly detected as a comment. Please report this issue upstream. The resulting HTML is:
Again, it appears that this is weird behavior by the Pygments Terraform lexer, but something we can workaround. The lexer seems to generate empty comment nodes, which we did not intercept. This is fixed in 104c8c8. It would be great if you could report the empty comment nodes upstream. The generated nodes are:
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
I tried to use Code Annotations with Terraform syntax highlighting as the following:
index.md
Expected behaviour
Code Annotations should render correctly for both code blocks.
Actual behaviour
HTLM output looks like this:
Problem 1
It looks like
# (2)
is not treated as a comment. At least it isn't highlighted the same way as the other comment.Problem 2
Browser is throwing the following exception:
It seems like that there are empty
c
/c1
/cm
elements in code block which force this exception. Further, for any other code block after this one, annotations don't get rendered at all.Steps to reproduce
mkdocs.yaml
andindex.md
as providedmkdocs serve
with provided versionsPackage versions
Python 3.9.10
1.2.3
8.2.5
Configuration
System information
The text was updated successfully, but these errors were encountered: