2023-08-17 11:01:36 +00:00
|
|
|
# goldmark-inline-attributes
|
|
|
|
|
|
|
|
[GoldMark](https://github.com/yuin/goldmark/) inline attributes extension.
|
|
|
|
|
2023-08-17 12:58:53 +00:00
|
|
|
This implements the [`bracketed_spans`](https://pandoc.org/MANUAL.html#extension-bracketed_spans) of pandoc.
|
|
|
|
|
2023-08-17 11:01:36 +00:00
|
|
|
```markdown
|
2023-08-17 12:58:53 +00:00
|
|
|
[This is *some text*]{.class key="val"} outside text
|
2023-08-17 11:01:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```html
|
2023-08-17 12:58:53 +00:00
|
|
|
<p><span class="class" key="val">This is <em>some text</em></span> outside text</p>
|
2023-08-17 11:01:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```go
|
|
|
|
var md = goldmark.New(attributes.Enable)
|
|
|
|
var source = []byte("[Text]{#id .class1}\nother text")
|
|
|
|
err := md.Convert(source, os.Stdout)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
```
|