Skip to content

Commit

Permalink
Merge branch 'main' into feat/support-json-ld-for-ChangeClassLabelsOr…
Browse files Browse the repository at this point in the history
…CommentsRequestV2
  • Loading branch information
seakayone authored Feb 5, 2025
2 parents 006f452 + 3ed58b6 commit 59796e7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
30 changes: 28 additions & 2 deletions docs/03-endpoints/api-v2/text/standard-standoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,36 @@ Text with standard standoff markup can be transformed to TEI XML as described [h

## Footnotes

Footnote support is currently experimental and has some limitations:
The `<footnote>` tag is an anchor tag indicating where in the text a footnote should be placed.
It must not contain any text or other tags.

The contents of the footnote are stored in the `content` attribute of the `<footnote>` tag.
These may contain further markup, so the content of the footnote must be valid XML.

In order to result in valid xml, the content of the footnote must be properly escaped
so that it does not contain any characters that are not allowed in XML.
Special characters like `<`, `>`, `&`, `"`, and `'` must be replaced by their respective XML entities,
i.e. `&lt;`, `&gt;`, `&amp;`, `&quot;`, and `&apos;`.

The following example shows how a footnote is used in the XML:

```xml
<text>
<p>
Some text with a
footnote<footnote content="Text with &lt;a href=&quot;...&quot;&gt;markup&lt;/a&gt;." />
in it.
</p>
</text>
```

**Note:**
Footnote support is still in an early stage, and may change in the future.
There are some known limitations:

- CKE does not support footnotes out of the box. DSP-APP uses a custom build of CKE that supports footnotes.
- The content of footnotes is not covered by the full text search.
- The content of footnotes may contain further markup, but this will internally not be converted to standoff.
- The content of footnotes may contain further markup, but this will not be converted to standoff by the API.
For that reason, markup in footnotes can not be searched for through gravsearch
and hence outgoing and incoming links will not be displayed in DSP-APP.

Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,13 @@ class ValuesRouteV2E2ESpec extends E2ESpec {
val resourceIri: IRI = AThing.iri
val textValueAsXml: String =
"""|<?xml version="1.0" encoding="UTF-8"?>
|<text>This text has a footnote<footnote content="this is footnote content"/> containing text.</text>
|<text>
| <p>
| Some text with a
| footnote<footnote content="Text with &lt;a href=&quot;...&quot;&gt;markup&lt;/a&gt;." />
| in it.
| </p>
|</text>
|""".stripMargin

val propertyIri: SmartIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#hasText".toSmartIri
Expand Down

0 comments on commit 59796e7

Please sign in to comment.