-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
Description
Contribution guidelines
- I've read the contribution guidelines and wholeheartedly agree
I've found a bug and checked that ...
- ... the problem doesn't occur with the
mkdocsorreadthedocsthemes - ... the problem persists when all overrides are removed, i.e.
custom_dir,extra_javascriptandextra_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
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.yamlandindex.mdas provided - Run
mkdocs servewith provided versions
Package versions
- Python:
Python 3.9.10 - MkDocs:
1.2.3 - Material:
8.2.5
Configuration
site_name: Code Annotations with Terraform
theme:
name: material
features:
- content.code.annotate
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfencesSystem information
- Operating system: Windows 10
- Browser:
- Fire 5C27 fox 91.7.0esr (64-bit)
- Chrome 99.0.4844.51 (Official Build) (64-bit)
Metadata
Metadata
Assignees
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
