翻译者:Yuyan Jiang
原文链接:https://iiif.io/api/cookbook/recipe/0007-string-formats/
将 HTML 嵌入描述性属性中
用例
您希望通过向选定的文本块添加链接或简单格式化说明在控制元数据的显示方式更有掌控性。例如,科学名称可能需要特殊的格式化,并链接到其他站点并使其受益。遗留系统的输出中还可能包含基本格式。
实施说明
您可以仅在属性和对象中的属性中包含最少的 HTML 标记。不允许使用 HTML 或其他属性。您的 HTML 必须格式良好的XML ,因此必须包裹在一个元素p或span中。
要提醒内容是的消费应用程序, 字符串中的第一个字符必须是”<”,最后一个字符必须是”>”。如果您的内容是纯文本,但恰好以上面所述的角度括号开始和结束,请在值的末尾添加额外的空白字符。
限制
出于安全原因,客户只允许 a, b, br, i, img, p, small, span, sub, 和 sup 标签并可以删除任何或全部的上述标签。有关允许和禁止的标记的更多详细信息, 请参阅说明.
样例
JSON-LD | 在Universal Viewer中查看 | 在Mirador中查看
{"@context": "http://iiif.io/api/presentation/3/context.json","id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/manifest.json","type": "Manifest","label": {"en": ["Picture of Göttingen taken during the 2019 IIIF Conference"]},"summary": {"en": ["<p>Picture taken by the <a href=\"https://github.com/glenrobson\">IIIF Technical Coordinator</a></p>"]},"metadata": [{"label": {"en": ["Author"]},"value": {"none": ["<span><a href='https://github.com/glenrobson'>Glen Robson</a></span>"]}}],"rights": "http://creativecommons.org/licenses/by-sa/3.0/","requiredStatement": {"label": {"en": ["Attribution"]},"value": {"en": ["<span>Glen Robson, IIIF Technical Coordinator. <a href=\"https://creativecommons.org/licenses/by-sa/3.0\">CC BY-SA 3.0</a> <img src=\"https://licensebuttons.net/l/by-sa/3.0/88x31.png\"/></span>"]}},"items": [{"id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/canvas/p1","type": "Canvas","height": 3024,"width": 4032,"items": [{"id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/page/p1/1","type": "AnnotationPage","items": [{"id": "https://iiif.io/api/cookbook/recipe/0007-string-formats/annotation/p0001-image","type": "Annotation","motivation": "painting","body": {"id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg","type": "Image","format": "image/jpeg","height": 3024,"width": 4032,"service": [{"id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen","profile": "level1","type": "ImageService3"}]},"target": "https://iiif.io/api/cookbook/recipe/0007-string-formats/canvas/p1"}]}]}]}
相关专题
o 最简单的清单-单个图片文件
