summaryrefslogtreecommitdiffstats
path: root/tracker/attribute-emphases.mdnw
blob: 9f768e150776e5bccb171932dc524aeca2041c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
% Deal with meta emphases attributes


Meta listings does not support emphases and similar in e.g. titles:

```
% Here some *emphases* and **strong**
```

At least those elements should *not* be dropped. Instead formatting
can at the least be ignored or better taken into account some how.

This is a more full example:

```
---
title: Here some *emphases* and **strong**
abstract: |
  Cover _emphasis_ and __strong__ and ~~stroken out~~ and sub- and
  superscript e.g. H~2~O and 2^10^ and some `verbatim`. If all that,
  than nice. Then also a [link](/url) and <urldisplayed>
---
```

# Implementation notes

Details important for implementation:

 Blocks

  : *MetaBlocks*, *MetaInline* and *Plain* -- Containers for word
    sequences. Operate on the element again recursively.

 Space

  : *Space* and *SoftBreak* -- A space. Add space.

 String

  : *Str* -- A word. Add the word.


 Unknown

  : *MetaString* -- Have not seen

 Qualifiers

  : *Emph*, *Strong*, *Strikeout*, *Code*, *Subscript* and
    *Superscript* -- Formatting, but also containers for words. Do the
    same as for blocks.

 Special

  : *Link*, *RawInline* -- Need special treatment. *RawInline* has the
    contents of two elements, type and content. The second one should
    be used.

The internal Pandoc JSON:

```
{"blocks":[],"pandoc-api-version":[1,17,5,1],"meta":{"abstract":{"t":"MetaBlocks","c":[{"t":"Plain","c":[{"t":"Str","c":"Cover"},{"t":"Space"},{"t":"Emph","c":[{"t":"Str","c":"emphasis"}]},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"Strong","c":[{"t":"Str","c":"strong"}]},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"Strikeout","c":[{"t":"Str","c":"stroken"},{"t":"Space"},{"t":"Str","c":"out"}]},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"Str","c":"sub-"},{"t":"Space"},{"t":"Str","c":"and"},{"t":"SoftBreak"},{"t":"Str","c":"superscript"},{"t":"Space"},{"t":"Str","c":"e.g. H"},{"t":"Subscript","c":[{"t":"Str","c":"2"}]},{"t":"Str","c":"O"},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"Str","c":"2"},{"t":"Superscript","c":[{"t":"Str","c":"10"}]},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"Str","c":"some"},{"t":"Space"},{"t":"Code","c":[["",[],[]],"verbatim"]},{"t":"Str","c":"."},{"t":"Space"},{"t":"Str","c":"If"},{"t":"Space"},{"t":"Str","c":"all"},{"t":"Space"},{"t":"Str","c":"that,"},{"t":"SoftBreak"},{"t":"Str","c":"than"},{"t":"Space"},{"t":"Str","c":"nice."},{"t":"Space"},{"t":"Str","c":"Then"},{"t":"Space"},{"t":"Str","c":"alao"},{"t":"Space"},{"t":"Str","c":"a"},{"t":"Space"},{"t":"Link","c":[["",[],[]],[{"t":"Str","c":"link"}],["/url",""]]},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"RawInline","c":["html","<urldisplayed>"]}]}]},"title":{"t":"MetaInlines","c":[{"t":"Str","c":"Here"},{"t":"Space"},{"t":"Str","c":"some"},{"t":"Space"},{"t":"Emph","c":[{"t":"Str","c":"emphases"}]},{"t":"Space"},{"t":"Str","c":"and"},{"t":"Space"},{"t":"Strong","c":[{"t":"Str","c":"strong"}]}]}}}
```

and snippet:


```
{
  "meta": {
    "title": {
      "t": "MetaInlines",
      "c": [
        {
          "t": "Str",
          "c": "Here"
        },
        {
          "t": "Space"
        },
        {
          "t": "Str",
          "c": "some"
        },
        {
          "t": "Space"
        },
        {
          "t": "Emph",
          "c": [
            {
              "t": "Str",
              "c": "emphases"
            }
          ]
        },
        {
          "t": "Space"
        },
        {
          "t": "Str",
          "c": "and"
        },
        {
          "t": "Space"
        },
        {
          "t": "Strong",
          "c": [
            {
              "t": "Str",
              "c": "strong"
            }
          ]
        }
      ]
    }
  }
}
```