diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..63a50b349 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +docs/research/non-pdf-dom-evidence/standards/*.txt -whitespace diff --git a/backend/services/attachment_parser.py b/backend/services/attachment_parser.py index 51baf1904..77e4b0a59 100644 --- a/backend/services/attachment_parser.py +++ b/backend/services/attachment_parser.py @@ -44,6 +44,34 @@ class AttachmentParserDescriptor: extensions=(".md", ".markdown"), parse_status="parsed", ), + AttachmentParserDescriptor( + parser_key="json", + display_name="JSON attachments", + content_types=("application/json", "text/json"), + extensions=(".json",), + parse_status="parsed", + ), + AttachmentParserDescriptor( + parser_key="csv", + display_name="CSV attachments", + content_types=("text/csv", "application/csv"), + extensions=(".csv",), + parse_status="parsed", + ), + AttachmentParserDescriptor( + parser_key="xml", + display_name="XML attachments", + content_types=("application/xml", "text/xml"), + extensions=(".xml",), + parse_status="parsed", + ), + AttachmentParserDescriptor( + parser_key="calendar", + display_name="iCalendar attachments", + content_types=("text/calendar",), + extensions=(".ics", ".ifb"), + parse_status="parsed", + ), AttachmentParserDescriptor( parser_key="unsupported_binary", display_name="Unsupported binary attachments", diff --git a/backend/services/content_graph/parser.py b/backend/services/content_graph/parser.py index 14d535399..351fb859b 100644 --- a/backend/services/content_graph/parser.py +++ b/backend/services/content_graph/parser.py @@ -1,10 +1,16 @@ from __future__ import annotations +import csv import hashlib +import json import re from collections import defaultdict from dataclasses import dataclass, field from html.parser import HTMLParser +from io import StringIO + +from defusedxml import ElementTree as DefusedElementTree +from defusedxml.common import DefusedXmlException from services.text_safety import strip_html_markup @@ -37,6 +43,21 @@ "text/x-markdown", "application/markdown", } +_SUPPORTED_JSON_TYPES = { + "application/json", + "text/json", +} +_SUPPORTED_CSV_TYPES = { + "text/csv", + "application/csv", +} +_SUPPORTED_XML_TYPES = { + "application/xml", + "text/xml", +} +_SUPPORTED_CALENDAR_TYPES = { + "text/calendar", +} @dataclass(slots=True) @@ -297,6 +318,14 @@ def parse_content( return _parse_html(context, document_node, content) if normalized_type in _SUPPORTED_MARKDOWN_TYPES: return _parse_markdown(context, document_node, content) + if normalized_type in _SUPPORTED_JSON_TYPES or normalized_type.endswith("+json"): + return _parse_json(context, document_node, content) + if normalized_type in _SUPPORTED_CSV_TYPES: + return _parse_csv(context, document_node, content) + if normalized_type in _SUPPORTED_XML_TYPES or normalized_type.endswith("+xml"): + return _parse_xml(context, document_node, content) + if normalized_type in _SUPPORTED_CALENDAR_TYPES: + return _parse_calendar(context, document_node, content) if normalized_type == "text/plain": return _parse_plain_text(context, document_node, content) return _parse_plain_text(context, document_node, strip_html_markup(content)) @@ -408,6 +437,302 @@ def _parse_html( return context.result() +def _parse_json( + context: _BuildContext, + document_node: ContentNode, + content: str, +) -> ParseResult: + try: + payload = json.loads(content) + except (json.JSONDecodeError, TypeError, ValueError): + return _parse_plain_text(context, document_node, content) + + root_kind = "json_array" if isinstance(payload, list) else "json_object" + if not isinstance(payload, (dict, list)): + root_kind = "json_value" + root_node = context.add_node( + parent_node_uid=document_node.content_node_uid, + node_kind=root_kind, + node_path="/document[1]/json[1]", + ordinal_index=1, + display_label="$", + ) + _append_json_value( + context=context, + value=payload, + parent_node=root_node, + parent_path=root_node.node_path, + label="$", + heading_parts=[], + ) + return context.result() + + +def _append_json_value( + *, + context: _BuildContext, + value: object, + parent_node: ContentNode, + parent_path: str, + label: str, + heading_parts: list[str], +) -> None: + if isinstance(value, dict): + for index, (key, child_value) in enumerate(value.items(), start=1): + safe_key = _safe_label(str(key), fallback=f"field_{index}") + child_node = context.add_node( + parent_node_uid=parent_node.content_node_uid, + node_kind=( + "json_array" + if isinstance(child_value, list) + else "json_object" + if isinstance(child_value, dict) + else "json_value" + ), + node_path=f"{parent_path}/member[{index}]", + ordinal_index=index, + display_label=safe_key, + ) + _append_json_value( + context=context, + value=child_value, + parent_node=child_node, + parent_path=child_node.node_path, + label=safe_key, + heading_parts=[*heading_parts, safe_key], + ) + return + + if isinstance(value, list): + for index, child_value in enumerate(value, start=1): + safe_label = f"{label}[{index}]" + child_node = context.add_node( + parent_node_uid=parent_node.content_node_uid, + node_kind=( + "json_array" + if isinstance(child_value, list) + else "json_object" + if isinstance(child_value, dict) + else "json_value" + ), + node_path=f"{parent_path}/item[{index}]", + ordinal_index=index, + display_label=safe_label, + ) + _append_json_value( + context=context, + value=child_value, + parent_node=child_node, + parent_path=child_node.node_path, + label=safe_label, + heading_parts=[*heading_parts, safe_label], + ) + return + + safe_value = _safe_text(_json_scalar_text(value)) + if not safe_value: + return + safe_label = _safe_label(label, fallback="value") + safe_text = f"{safe_label}: {safe_value}" if safe_label != "$" else safe_value + context.add_segment( + content_node_uid=parent_node.content_node_uid, + segment_kind="json_value", + segment_path=parent_path, + heading_path=_join_heading_path(heading_parts), + safe_text_content=safe_text, + ) + + +def _parse_csv( + context: _BuildContext, + document_node: ContentNode, + content: str, +) -> ParseResult: + reader = csv.reader(StringIO(_normalize_newlines(content))) + rows = [[_safe_text(cell) for cell in row] for row in reader] + rows = [row for row in rows if any(cell for cell in row)] + if not rows: + return context.result() + + table_node = context.add_node( + parent_node_uid=document_node.content_node_uid, + node_kind="table", + node_path="/document[1]/table[1]", + ordinal_index=1, + ) + headers = rows[0] if len(rows) > 1 else [] + for row_index, row in enumerate(rows, start=1): + node_kind = "table_header" if row_index == 1 and headers else "table_row" + segment_kind = "table_header" if node_kind == "table_header" else "table_row" + row_node = context.add_node( + parent_node_uid=table_node.content_node_uid, + node_kind=node_kind, + node_path=f"{table_node.node_path}/row[{row_index}]", + ordinal_index=row_index, + safe_text_content=_csv_row_text(row, headers if row_index > 1 else []), + ) + context.add_segment( + content_node_uid=row_node.content_node_uid, + segment_kind=segment_kind, + segment_path=row_node.node_path, + heading_path=None, + safe_text_content=row_node.safe_text_content, + ) + return context.result() + + +def _parse_xml( + context: _BuildContext, + document_node: ContentNode, + content: str, +) -> ParseResult: + try: + root = DefusedElementTree.fromstring(content) + except (DefusedXmlException, DefusedElementTree.ParseError, TypeError, ValueError): + return _parse_plain_text(context, document_node, strip_html_markup(content)) + + root_label = _xml_tag_name(str(root.tag)) + root_node = context.add_node( + parent_node_uid=document_node.content_node_uid, + node_kind="xml_element", + node_path="/document[1]/xml[1]", + ordinal_index=1, + display_label=root_label, + safe_text_content=_safe_text(root.text or ""), + ) + _append_xml_text_segment(context, root_node, [root_label]) + _append_xml_children( + context=context, + parent_node=root_node, + parent_path=root_node.node_path, + parent_headings=[root_label], + elements=list(root), + ) + return context.result() + + +def _append_xml_children( + *, + context: _BuildContext, + parent_node: ContentNode, + parent_path: str, + parent_headings: list[str], + elements: list, +) -> None: + counts: defaultdict[str, int] = defaultdict(int) + for element in elements: + tag_label = _xml_tag_name(str(element.tag)) + counts[tag_label] += 1 + ordinal_index = counts[tag_label] + node = context.add_node( + parent_node_uid=parent_node.content_node_uid, + node_kind="xml_element", + node_path=f"{parent_path}/{tag_label}[{ordinal_index}]", + ordinal_index=ordinal_index, + display_label=tag_label, + safe_text_content=_safe_text(element.text or ""), + ) + headings = [*parent_headings, tag_label] + _append_xml_text_segment(context, node, headings) + _append_xml_children( + context=context, + parent_node=node, + parent_path=node.node_path, + parent_headings=headings, + elements=list(element), + ) + + +def _append_xml_text_segment( + context: _BuildContext, + node: ContentNode, + heading_parts: list[str], +) -> None: + if not node.safe_text_content: + return + context.add_segment( + content_node_uid=node.content_node_uid, + segment_kind="xml_text", + segment_path=f"{node.node_path}/text[1]", + heading_path=_join_heading_path(heading_parts), + safe_text_content=node.safe_text_content, + ) + + +def _parse_calendar( + context: _BuildContext, + document_node: ContentNode, + content: str, +) -> ParseResult: + calendar_node = context.add_node( + parent_node_uid=document_node.content_node_uid, + node_kind="calendar", + node_path="/document[1]/calendar[1]", + ordinal_index=1, + display_label="VCALENDAR", + ) + component_stack: list[ContentNode] = [calendar_node] + component_path_stack = [calendar_node.node_path] + component_counts: defaultdict[str, int] = defaultdict(int) + property_index = 0 + + for raw_line in _unfold_calendar_lines(content): + if ":" not in raw_line: + continue + property_name_with_params, raw_value = raw_line.split(":", 1) + property_name = _safe_label( + property_name_with_params.split(";", 1)[0].upper(), + fallback="PROPERTY", + ) + if property_name == "BEGIN": + component_label = _safe_label(raw_value.upper(), fallback="COMPONENT") + component_counts[component_label] += 1 + ordinal_index = component_counts[component_label] + parent_node = component_stack[-1] + parent_path = component_path_stack[-1] + component_node = context.add_node( + parent_node_uid=parent_node.content_node_uid, + node_kind="calendar_component", + node_path=( + f"{parent_path}/{component_label.lower()}[{ordinal_index}]" + ), + ordinal_index=ordinal_index, + display_label=component_label, + ) + component_stack.append(component_node) + component_path_stack.append(component_node.node_path) + continue + if property_name == "END": + if len(component_stack) > 1: + component_stack.pop() + component_path_stack.pop() + continue + + safe_value = _safe_text(raw_value) + if not safe_value: + continue + property_index += 1 + parent_node = component_stack[-1] + parent_path = component_path_stack[-1] + property_node = context.add_node( + parent_node_uid=parent_node.content_node_uid, + node_kind="calendar_property", + node_path=f"{parent_path}/property[{property_index}]", + ordinal_index=property_index, + display_label=property_name, + safe_text_content=f"{property_name}: {safe_value}", + ) + context.add_segment( + content_node_uid=property_node.content_node_uid, + segment_kind="calendar_property", + segment_path=property_node.node_path, + heading_path=parent_node.display_label, + safe_text_content=property_node.safe_text_content, + ) + + return context.result() + + def _add_document_node(context: _BuildContext, display_name: str) -> ContentNode: return context.add_node( parent_node_uid=None, @@ -455,6 +780,44 @@ def _join_heading_path(headings: list[str]) -> str | None: return " > ".join(headings) if headings else None +def _json_scalar_text(value: object) -> str: + if isinstance(value, str): + return value + return json.dumps(value, ensure_ascii=False, sort_keys=True) + + +def _csv_row_text(row: list[str], headers: list[str]) -> str: + if not headers: + return ", ".join(cell for cell in row if cell) + pairs = [] + for index, cell in enumerate(row): + header = headers[index] if index < len(headers) and headers[index] else None + pairs.append(f"{header or f'column_{index + 1}'}={cell}") + return "; ".join(pairs) + + +def _xml_tag_name(tag: str) -> str: + local_name = tag.rsplit("}", maxsplit=1)[-1] + return _safe_label(local_name, fallback="element") + + +def _safe_label(value: str, *, fallback: str) -> str: + safe_value = _safe_text(value) + return safe_value or fallback + + +def _unfold_calendar_lines(content: str) -> list[str]: + unfolded: list[str] = [] + for line in _normalize_newlines(content).split("\n"): + if not line: + continue + if line.startswith((" ", "\t")) and unfolded: + unfolded[-1] += line[1:] + continue + unfolded.append(line) + return unfolded + + def _hash_text(value: str) -> str: return hashlib.sha256(value.encode("utf-8", errors="surrogatepass")).hexdigest() diff --git a/backend/services/email_import_service.py b/backend/services/email_import_service.py index c699d6182..c745bcccd 100644 --- a/backend/services/email_import_service.py +++ b/backend/services/email_import_service.py @@ -321,6 +321,14 @@ def _fallback_attachment_parser_key( ) -> str: if parse_status == "unsupported_content_type": return "unsupported_binary" + if parse_content_type in {"application/json", "text/json"}: + return "json" + if parse_content_type in {"text/csv", "application/csv"}: + return "csv" + if parse_content_type in {"application/xml", "text/xml"}: + return "xml" + if parse_content_type == "text/calendar": + return "calendar" if parse_content_type == "text/html": return "html" if parse_content_type in {"text/markdown", "text/x-markdown", "application/markdown"}: diff --git a/backend/tests/test_attachment_parser.py b/backend/tests/test_attachment_parser.py index e7c92013a..4da65d63d 100644 --- a/backend/tests/test_attachment_parser.py +++ b/backend/tests/test_attachment_parser.py @@ -40,12 +40,31 @@ def test_parser_manifest_lists_supported_and_unsupported_format_families(): manifest = get_attachment_parser_manifest() parser_keys = {descriptor.parser_key for descriptor in manifest} - assert {"plain_text", "html", "markdown", "unsupported_binary"} <= parser_keys + assert { + "plain_text", + "html", + "markdown", + "json", + "csv", + "xml", + "calendar", + "unsupported_binary", + } <= parser_keys markdown_descriptor = next( descriptor for descriptor in manifest if descriptor.parser_key == "markdown" ) assert "text/markdown" in markdown_descriptor.content_types assert ".md" in markdown_descriptor.extensions + json_descriptor = next( + descriptor for descriptor in manifest if descriptor.parser_key == "json" + ) + assert "application/json" in json_descriptor.content_types + assert ".json" in json_descriptor.extensions + calendar_descriptor = next( + descriptor for descriptor in manifest if descriptor.parser_key == "calendar" + ) + assert "text/calendar" in calendar_descriptor.content_types + assert ".ics" in calendar_descriptor.extensions def test_generic_binary_content_type_can_fall_back_to_markdown_extension(): @@ -62,6 +81,46 @@ def test_generic_binary_content_type_can_fall_back_to_markdown_extension(): assert result.content == "# Plan Ship graph" +def test_generic_binary_content_type_can_fall_back_to_json_extension(): + result = parse_email_attachment( + filename="status.json", + content_type="application/octet-stream", + raw_content='{"project": "Launch"}', + ) + + assert result.content_type == "application/octet-stream" + assert result.parse_content_type == "application/json" + assert result.parser_key == "json" + assert result.parse_status == "parsed" + assert result.content == '{"project": "Launch"}' + + +def test_structured_non_pdf_attachment_media_types_are_parseable(): + cases = [ + ("status.csv", "text/csv; charset=utf-8", "name,status\nLaunch,Ready", "csv"), + ("status.xml", "application/xml", "Launch", "xml"), + ( + "invite.ics", + "text/calendar", + "BEGIN:VCALENDAR\nSUMMARY:Launch\nEND:VCALENDAR", + "calendar", + ), + ] + + for filename, content_type, raw_content, parser_key in cases: + result = parse_email_attachment( + filename=filename, + content_type=content_type, + raw_content=raw_content, + ) + + assert result.filename == filename + assert result.parser_key == parser_key + assert result.parse_status == "parsed" + assert result.parse_error_code is None + assert result.parse_content == raw_content + + def test_oversized_text_attachment_is_metadata_only_without_raw_content(): result = parse_email_attachment( filename="huge.txt", diff --git a/backend/tests/test_content_graph_parser.py b/backend/tests/test_content_graph_parser.py index c130e2cd6..ea07f7bcb 100644 --- a/backend/tests/test_content_graph_parser.py +++ b/backend/tests/test_content_graph_parser.py @@ -125,6 +125,129 @@ def test_markdown_content_attaches_heading_path_to_paragraph_segments(): ] +def test_json_content_builds_scalar_segments_with_member_paths(): + content = """{ + "project": "Launch", + "risk": {"level": "high"}, + "tasks": ["Parse JSON", "Store segments"] + }""" + + result = parse_content( + source_kind="attachment", + source_record_uid="attachment-json", + content=content, + content_type="application/json", + display_name="status.json", + ) + + assert [segment.segment_kind for segment in result.segments] == [ + "json_value", + "json_value", + "json_value", + "json_value", + ] + assert [segment.safe_text_content for segment in result.segments] == [ + "project: Launch", + "level: high", + "tasks[1]: Parse JSON", + "tasks[2]: Store segments", + ] + assert [segment.heading_path for segment in result.segments] == [ + "project", + "risk > level", + "tasks > tasks[1]", + "tasks > tasks[2]", + ] + + +def test_csv_content_builds_header_and_row_segments(): + content = "name,status\nLaunch,Ready\nGraph,Blocked\n" + + result = parse_content( + source_kind="attachment", + source_record_uid="attachment-csv", + content=content, + content_type="text/csv", + display_name="status.csv", + ) + + assert [segment.segment_kind for segment in result.segments] == [ + "table_header", + "table_row", + "table_row", + ] + assert [segment.safe_text_content for segment in result.segments] == [ + "name, status", + "name=Launch; status=Ready", + "name=Graph; status=Blocked", + ] + assert [segment.segment_path for segment in result.segments] == [ + "/document[1]/table[1]/row[1]", + "/document[1]/table[1]/row[2]", + "/document[1]/table[1]/row[3]", + ] + + +def test_xml_content_uses_defused_parser_and_element_text_segments(): + content = "LaunchShip graph" + + result = parse_content( + source_kind="attachment", + source_record_uid="attachment-xml", + content=content, + content_type="application/xml", + display_name="status.xml", + ) + + assert [segment.segment_kind for segment in result.segments] == [ + "xml_text", + "xml_text", + ] + assert [segment.safe_text_content for segment in result.segments] == [ + "Launch", + "Ship graph", + ] + assert [segment.heading_path for segment in result.segments] == [ + "root > title", + "root > item", + ] + + +def test_calendar_content_unfolds_lines_into_property_segments(): + content = "\r\n".join( + [ + "BEGIN:VCALENDAR", + "BEGIN:VEVENT", + "SUMMARY:Launch review", + "DESCRIPTION:Line one", + " continued", + "DTSTART:20260711T090000Z", + "END:VEVENT", + "END:VCALENDAR", + ] + ) + + result = parse_content( + source_kind="attachment", + source_record_uid="attachment-ics", + content=content, + content_type="text/calendar", + display_name="invite.ics", + ) + + assert [segment.segment_kind for segment in result.segments] == [ + "calendar_property", + "calendar_property", + "calendar_property", + ] + assert [segment.safe_text_content for segment in result.segments] == [ + "SUMMARY: Launch review", + "DESCRIPTION: Line onecontinued", + "DTSTART: 20260711T090000Z", + ] + assert all(segment.heading_path == "VEVENT" for segment in result.segments) + + def test_unknown_content_type_uses_safe_text_fallback(): result = parse_content( source_kind="attachment", diff --git a/backend/tests/test_email_import_service.py b/backend/tests/test_email_import_service.py index 225cbe610..c667e4eed 100644 --- a/backend/tests/test_email_import_service.py +++ b/backend/tests/test_email_import_service.py @@ -267,6 +267,98 @@ def test_build_email_object_persists_attachment_parse_metadata(): assert email_obj.attachments[1].content_segments == [] +def test_build_email_object_attaches_structured_non_pdf_content_graph_records(): + parsed = { + "message_id": "", + "sender": "sender@example.com", + "reply_to": None, + "recipients": "owner@example.com", + "subject": "Structured attachments", + "in_reply_to": None, + "references": None, + "body": "See attached", + "body_content_type": "text/plain", + "body_parse_content": "See attached", + "attachments": [ + { + "filename": "status.json", + "content": '{"project":"Launch"}', + "content_type": "application/json", + "parse_content": '{"project":"Launch"}', + "parse_content_type": "application/json", + "parser_key": "json", + "parse_status": "parsed", + "parse_error_code": None, + }, + { + "filename": "status.csv", + "content": "name,status Launch,Ready", + "content_type": "text/csv", + "parse_content": "name,status\nLaunch,Ready", + "parse_content_type": "text/csv", + "parser_key": "csv", + "parse_status": "parsed", + "parse_error_code": None, + }, + { + "filename": "status.xml", + "content": "Launch", + "content_type": "application/xml", + "parse_content": "Launch", + "parse_content_type": "application/xml", + "parser_key": "xml", + "parse_status": "parsed", + "parse_error_code": None, + }, + { + "filename": "invite.ics", + "content": "BEGIN:VCALENDAR SUMMARY:Launch END:VCALENDAR", + "content_type": "text/calendar", + "parse_content": "BEGIN:VCALENDAR\nSUMMARY:Launch\nEND:VCALENDAR", + "parse_content_type": "text/calendar", + "parser_key": "calendar", + "parse_status": "parsed", + "parse_error_code": None, + }, + ], + } + + email_obj, attachment_count = email_import_module._build_email_object( + parsed=parsed, + user_id="user-1", + organization_id="org-1", + message_id="", + thread_id="thread-1", + fingerprint="fingerprint-1", + persisted_date=datetime.datetime(2026, 7, 2, tzinfo=datetime.timezone.utc), + attachment_payloads=list(parsed["attachments"]), + fitted_embeddings=[ + [0.0] * EMBEDDING_DIMENSION, + [0.0] * EMBEDDING_DIMENSION, + [0.0] * EMBEDDING_DIMENSION, + [0.0] * EMBEDDING_DIMENSION, + [0.0] * EMBEDDING_DIMENSION, + ], + ) + + assert attachment_count == 4 + segment_text_by_filename = { + attachment.filename: [ + segment.safe_text_content for segment in attachment.content_segments + ] + for attachment in email_obj.attachments + } + assert segment_text_by_filename == { + "status.json": ["project: Launch"], + "status.csv": ["name, status", "name=Launch; status=Ready"], + "status.xml": ["Launch"], + "invite.ics": ["SUMMARY: Launch"], + } + assert { + attachment.parser_key for attachment in email_obj.attachments + } == {"json", "csv", "xml", "calendar"} + + @pytest.mark.asyncio async def test_import_single_eml_offloads_read_and_parse(monkeypatch, tmp_path): eml_path = tmp_path / "message.eml" diff --git a/backend/tests/test_email_parser.py b/backend/tests/test_email_parser.py index 9f8894941..2a3b9b893 100644 --- a/backend/tests/test_email_parser.py +++ b/backend/tests/test_email_parser.py @@ -175,6 +175,29 @@ def test_parse_eml_extracts_supported_and_unsupported_attachment_metadata(): Ship graph --mixed-boundary +Content-Type: application/json; charset="utf-8" +Content-Disposition: attachment; filename="status.json" + +{"project":"Launch"} +--mixed-boundary +Content-Type: text/csv; charset="utf-8" +Content-Disposition: attachment; filename="status.csv" + +name,status +Launch,Ready +--mixed-boundary +Content-Type: application/xml; charset="utf-8" +Content-Disposition: attachment; filename="status.xml" + +Launch +--mixed-boundary +Content-Type: text/calendar; charset="utf-8" +Content-Disposition: attachment; filename="invite.ics" + +BEGIN:VCALENDAR +SUMMARY:Launch +END:VCALENDAR +--mixed-boundary Content-Type: application/pdf Content-Disposition: attachment; filename="contract.pdf" Content-Transfer-Encoding: base64 @@ -209,6 +232,46 @@ def test_parse_eml_extracts_supported_and_unsupported_attachment_metadata(): "parse_status": "parsed", "parse_error_code": None, }, + { + "filename": "status.json", + "content": '{"project":"Launch"}', + "content_type": "application/json", + "parse_content": '{"project":"Launch"}', + "parse_content_type": "application/json", + "parser_key": "json", + "parse_status": "parsed", + "parse_error_code": None, + }, + { + "filename": "status.csv", + "content": "name,status Launch,Ready", + "content_type": "text/csv", + "parse_content": "name,status\nLaunch,Ready", + "parse_content_type": "text/csv", + "parser_key": "csv", + "parse_status": "parsed", + "parse_error_code": None, + }, + { + "filename": "status.xml", + "content": "Launch", + "content_type": "application/xml", + "parse_content": "Launch", + "parse_content_type": "application/xml", + "parser_key": "xml", + "parse_status": "parsed", + "parse_error_code": None, + }, + { + "filename": "invite.ics", + "content": "BEGIN:VCALENDAR SUMMARY:Launch END:VCALENDAR", + "content_type": "text/calendar", + "parse_content": "BEGIN:VCALENDAR\nSUMMARY:Launch\nEND:VCALENDAR", + "parse_content_type": "text/calendar", + "parser_key": "calendar", + "parse_status": "parsed", + "parse_error_code": None, + }, { "filename": "contract.pdf", "content": "", diff --git a/docs/research/non-pdf-dom-evidence/README.md b/docs/research/non-pdf-dom-evidence/README.md new file mode 100644 index 000000000..109dc3737 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/README.md @@ -0,0 +1,80 @@ +# Non-PDF DOM Evidence Pack + +This pack grounds the Naruon P0 work item +`ContextualWisdomLab/naruon#1021`: parse non-PDF formats into the existing +`content_graph` / KG substrate. + +## Implementation Scope + +The implemented slice keeps `backend/services/content_graph/` as an internal +Naruon package. It does not create a new repository, submodule, package, or +domain because the repo-local architecture note says extraction should wait +until the parser API, segment schema, failure taxonomy, and golden tests have +stabilized and at least a second consumer exists. + +Formats covered in this slice: + +- `text/html` - existing safe block DOM parser, backed by the WHATWG HTML + Living Standard and RFC 2854 media type registration. +- `text/markdown`, `text/x-markdown`, `application/markdown` - existing heading + and paragraph parser, backed by CommonMark 0.31.2 and RFC 7763. +- `text/plain` - existing paragraph parser. +- `application/json`, `text/json`, and `+json` structured media types - new + object/array/value segment parser. +- `text/csv`, `application/csv` - new row segment parser using RFC 4180-style + rows and optional header treatment. +- `application/xml`, `text/xml`, and `+xml` structured media types - new + `defusedxml` element-text parser following RFC 7303 media type boundaries. +- `text/calendar` - new property segment parser with RFC 5545 folded-line + unfolding; RFC 9073 is preserved as the current event-publishing extension + reference. + +Unsupported binary formats still remain unsupported instead of being treated as +successful empty analysis. + +## Preserved PDF Originals + +- `pdfs/whatwg-html-living-standard-2026-07-10.pdf` + - Source: https://html.spec.whatwg.org/print.pdf + - Use: latest checked HTML Living Standard PDF, including DOM and parsing + context for safe HTML block extraction. +- `pdfs/peters-lecocq-2013-content-extraction-using-diverse-feature-sets.pdf` + - Source: https://archives.iw3c2.org/www2013/companion/p89.pdf + - Use: research grounding for treating document extraction as block-level + content extraction rather than raw blob storage. +- `pdfs/bevendorff-2023-empirical-comparison-web-content-extraction-algorithms.pdf` + - Source: https://downloads.webis.de/publications/papers/bevendorff_2023c.pdf + - Use: research grounding for keeping extraction evidence-oriented and + benchmarkable before promoting it to a standalone product. + +## Preserved Standard Text Originals + +RFC Editor and CommonMark publish these references primarily as text or HTML; +official RFC PDF endpoints were not available through RFC Editor for these +documents at capture time, so the original text forms are preserved instead of +generating derivative PDFs. + +- `standards/commonmark-0.31.2-spec.txt` + - Source: https://spec.commonmark.org/0.31.2/spec.txt +- `standards/rfc2854-text-html.txt` + - Source: https://www.rfc-editor.org/rfc/rfc2854.txt +- `standards/rfc4180-csv.txt` + - Source: https://www.rfc-editor.org/rfc/rfc4180.txt +- `standards/rfc5545-icalendar.txt` + - Source: https://www.rfc-editor.org/rfc/rfc5545.txt +- `standards/rfc7303-xml-media-types.txt` + - Source: https://www.rfc-editor.org/rfc/rfc7303.txt +- `standards/rfc7763-text-markdown.txt` + - Source: https://www.rfc-editor.org/rfc/rfc7763.txt +- `standards/rfc8259-json.txt` + - Source: https://www.rfc-editor.org/rfc/rfc8259.txt +- `standards/rfc9073-icalendar-event-publishing-extensions.txt` + - Source: https://www.rfc-editor.org/rfc/rfc9073.txt + +## Governance Notes + +- Project #1 item: `ContextualWisdomLab/naruon#1021`. +- Governing protocol: `ContextualWisdomLab/.github#363`. +- Restored planning file: `docs/planning/naruon-platform-plan.md`, because + Project #1 and `.github#363` reference it as the roadmap detail source. +- Git LFS is intentionally not used; the largest committed PDF is about 16 MB. diff --git a/docs/research/non-pdf-dom-evidence/pdfs/bevendorff-2023-empirical-comparison-web-content-extraction-algorithms.pdf b/docs/research/non-pdf-dom-evidence/pdfs/bevendorff-2023-empirical-comparison-web-content-extraction-algorithms.pdf new file mode 100644 index 000000000..49c0aaba8 Binary files /dev/null and b/docs/research/non-pdf-dom-evidence/pdfs/bevendorff-2023-empirical-comparison-web-content-extraction-algorithms.pdf differ diff --git a/docs/research/non-pdf-dom-evidence/pdfs/peters-lecocq-2013-content-extraction-using-diverse-feature-sets.pdf b/docs/research/non-pdf-dom-evidence/pdfs/peters-lecocq-2013-content-extraction-using-diverse-feature-sets.pdf new file mode 100644 index 000000000..e42b95f50 Binary files /dev/null and b/docs/research/non-pdf-dom-evidence/pdfs/peters-lecocq-2013-content-extraction-using-diverse-feature-sets.pdf differ diff --git a/docs/research/non-pdf-dom-evidence/pdfs/whatwg-html-living-standard-2026-07-10.pdf b/docs/research/non-pdf-dom-evidence/pdfs/whatwg-html-living-standard-2026-07-10.pdf new file mode 100644 index 000000000..bbbc6f10b Binary files /dev/null and b/docs/research/non-pdf-dom-evidence/pdfs/whatwg-html-living-standard-2026-07-10.pdf differ diff --git a/docs/research/non-pdf-dom-evidence/standards/commonmark-0.31.2-spec.txt b/docs/research/non-pdf-dom-evidence/standards/commonmark-0.31.2-spec.txt new file mode 100644 index 000000000..4b2d4b499 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/commonmark-0.31.2-spec.txt @@ -0,0 +1,9748 @@ +# Introduction + +## What is Markdown? + +Markdown is a plain text format for writing structured documents, +based on conventions for indicating formatting in email +and usenet posts. It was developed by John Gruber (with +help from Aaron Swartz) and released in 2004 in the form of a +[syntax description](https://daringfireball.net/projects/markdown/syntax) +and a Perl script (`Markdown.pl`) for converting Markdown to +HTML. In the next decade, dozens of implementations were +developed in many languages. Some extended the original +Markdown syntax with conventions for footnotes, tables, and +other document elements. Some allowed Markdown documents to be +rendered in formats other than HTML. Websites like Reddit, +StackOverflow, and GitHub had millions of people using Markdown. +And Markdown started to be used beyond the web, to author books, +articles, slide shows, letters, and lecture notes. + +What distinguishes Markdown from many other lightweight markup +syntaxes, which are often easier to write, is its readability. +As Gruber writes: + +> The overriding design goal for Markdown's formatting syntax is +> to make it as readable as possible. The idea is that a +> Markdown-formatted document should be publishable as-is, as +> plain text, without looking like it's been marked up with tags +> or formatting instructions. +> () + +The point can be illustrated by comparing a sample of +[AsciiDoc](https://asciidoc.org/) with +an equivalent sample of Markdown. Here is a sample of +AsciiDoc from the AsciiDoc manual: + +``` +1. List item one. ++ +List item one continued with a second paragraph followed by an +Indented block. ++ +................. +$ ls *.sh +$ mv *.sh ~/tmp +................. ++ +List item continued with a third paragraph. + +2. List item two continued with an open block. ++ +-- +This paragraph is part of the preceding list item. + +a. This list is nested and does not require explicit item +continuation. ++ +This paragraph is part of the preceding list item. + +b. List item b. + +This paragraph belongs to item two of the outer list. +-- +``` + +And here is the equivalent in Markdown: +``` +1. List item one. + + List item one continued with a second paragraph followed by an + Indented block. + + $ ls *.sh + $ mv *.sh ~/tmp + + List item continued with a third paragraph. + +2. List item two continued with an open block. + + This paragraph is part of the preceding list item. + + 1. This list is nested and does not require explicit item continuation. + + This paragraph is part of the preceding list item. + + 2. List item b. + + This paragraph belongs to item two of the outer list. +``` + +The AsciiDoc version is, arguably, easier to write. You don't need +to worry about indentation. But the Markdown version is much easier +to read. The nesting of list items is apparent to the eye in the +source, not just in the processed document. + +## Why is a spec needed? + +John Gruber's [canonical description of Markdown's +syntax](https://daringfireball.net/projects/markdown/syntax) +does not specify the syntax unambiguously. Here are some examples of +questions it does not answer: + +1. How much indentation is needed for a sublist? The spec says that + continuation paragraphs need to be indented four spaces, but is + not fully explicit about sublists. It is natural to think that + they, too, must be indented four spaces, but `Markdown.pl` does + not require that. This is hardly a "corner case," and divergences + between implementations on this issue often lead to surprises for + users in real documents. (See [this comment by John + Gruber](https://web.archive.org/web/20170611172104/http://article.gmane.org/gmane.text.markdown.general/1997).) + +2. Is a blank line needed before a block quote or heading? + Most implementations do not require the blank line. However, + this can lead to unexpected results in hard-wrapped text, and + also to ambiguities in parsing (note that some implementations + put the heading inside the blockquote, while others do not). + (John Gruber has also spoken [in favor of requiring the blank + lines](https://web.archive.org/web/20170611172104/http://article.gmane.org/gmane.text.markdown.general/2146).) + +3. Is a blank line needed before an indented code block? + (`Markdown.pl` requires it, but this is not mentioned in the + documentation, and some implementations do not require it.) + + ``` markdown + paragraph + code? + ``` + +4. What is the exact rule for determining when list items get + wrapped in `

` tags? Can a list be partially "loose" and partially + "tight"? What should we do with a list like this? + + ``` markdown + 1. one + + 2. two + 3. three + ``` + + Or this? + + ``` markdown + 1. one + - a + + - b + 2. two + ``` + + (There are some relevant comments by John Gruber + [here](https://web.archive.org/web/20170611172104/http://article.gmane.org/gmane.text.markdown.general/2554).) + +5. Can list markers be indented? Can ordered list markers be right-aligned? + + ``` markdown + 8. item 1 + 9. item 2 + 10. item 2a + ``` + +6. Is this one list with a thematic break in its second item, + or two lists separated by a thematic break? + + ``` markdown + * a + * * * * * + * b + ``` + +7. When list markers change from numbers to bullets, do we have + two lists or one? (The Markdown syntax description suggests two, + but the perl scripts and many other implementations produce one.) + + ``` markdown + 1. fee + 2. fie + - foe + - fum + ``` + +8. What are the precedence rules for the markers of inline structure? + For example, is the following a valid link, or does the code span + take precedence ? + + ``` markdown + [a backtick (`)](/url) and [another backtick (`)](/url). + ``` + +9. What are the precedence rules for markers of emphasis and strong + emphasis? For example, how should the following be parsed? + + ``` markdown + *foo *bar* baz* + ``` + +10. What are the precedence rules between block-level and inline-level + structure? For example, how should the following be parsed? + + ``` markdown + - `a long code span can contain a hyphen like this + - and it can screw things up` + ``` + +11. Can list items include section headings? (`Markdown.pl` does not + allow this, but does allow blockquotes to include headings.) + + ``` markdown + - # Heading + ``` + +12. Can list items be empty? + + ``` markdown + * a + * + * b + ``` + +13. Can link references be defined inside block quotes or list items? + + ``` markdown + > Blockquote [foo]. + > + > [foo]: /url + ``` + +14. If there are multiple definitions for the same reference, which takes + precedence? + + ``` markdown + [foo]: /url1 + [foo]: /url2 + + [foo][] + ``` + +In the absence of a spec, early implementers consulted `Markdown.pl` +to resolve these ambiguities. But `Markdown.pl` was quite buggy, and +gave manifestly bad results in many cases, so it was not a +satisfactory replacement for a spec. + +Because there is no unambiguous spec, implementations have diverged +considerably. As a result, users are often surprised to find that +a document that renders one way on one system (say, a GitHub wiki) +renders differently on another (say, converting to docbook using +pandoc). To make matters worse, because nothing in Markdown counts +as a "syntax error," the divergence often isn't discovered right away. + +## About this document + +This document attempts to specify Markdown syntax unambiguously. +It contains many examples with side-by-side Markdown and +HTML. These are intended to double as conformance tests. An +accompanying script `spec_tests.py` can be used to run the tests +against any Markdown program: + + python test/spec_tests.py --spec spec.txt --program PROGRAM + +Since this document describes how Markdown is to be parsed into +an abstract syntax tree, it would have made sense to use an abstract +representation of the syntax tree instead of HTML. But HTML is capable +of representing the structural distinctions we need to make, and the +choice of HTML for the tests makes it possible to run the tests against +an implementation without writing an abstract syntax tree renderer. + +Note that not every feature of the HTML samples is mandated by +the spec. For example, the spec says what counts as a link +destination, but it doesn't mandate that non-ASCII characters in +the URL be percent-encoded. To use the automatic tests, +implementers will need to provide a renderer that conforms to +the expectations of the spec examples (percent-encoding +non-ASCII characters in URLs). But a conforming implementation +can use a different renderer and may choose not to +percent-encode non-ASCII characters in URLs. + +This document is generated from a text file, `spec.txt`, written +in Markdown with a small extension for the side-by-side tests. +The script `tools/makespec.py` can be used to convert `spec.txt` into +HTML or CommonMark (which can then be converted into other formats). + +In the examples, the `→` character is used to represent tabs. + +# Preliminaries + +## Characters and lines + +Any sequence of [characters] is a valid CommonMark +document. + +A [character](@) is a Unicode code point. Although some +code points (for example, combining accents) do not correspond to +characters in an intuitive sense, all code points count as characters +for purposes of this spec. + +This spec does not specify an encoding; it thinks of lines as composed +of [characters] rather than bytes. A conforming parser may be limited +to a certain encoding. + +A [line](@) is a sequence of zero or more [characters] +other than line feed (`U+000A`) or carriage return (`U+000D`), +followed by a [line ending] or by the end of file. + +A [line ending](@) is a line feed (`U+000A`), a carriage return +(`U+000D`) not followed by a line feed, or a carriage return and a +following line feed. + +A line containing no characters, or a line containing only spaces +(`U+0020`) or tabs (`U+0009`), is called a [blank line](@). + +The following definitions of character classes will be used in this spec: + +A [Unicode whitespace character](@) is a character in the Unicode `Zs` general +category, or a tab (`U+0009`), line feed (`U+000A`), form feed (`U+000C`), or +carriage return (`U+000D`). + +[Unicode whitespace](@) is a sequence of one or more +[Unicode whitespace characters]. + +A [tab](@) is `U+0009`. + +A [space](@) is `U+0020`. + +An [ASCII control character](@) is a character between `U+0000–1F` (both +including) or `U+007F`. + +An [ASCII punctuation character](@) +is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, +`*`, `+`, `,`, `-`, `.`, `/` (U+0021–2F), +`:`, `;`, `<`, `=`, `>`, `?`, `@` (U+003A–0040), +`[`, `\`, `]`, `^`, `_`, `` ` `` (U+005B–0060), +`{`, `|`, `}`, or `~` (U+007B–007E). + +A [Unicode punctuation character](@) is a character in the Unicode `P` +(puncuation) or `S` (symbol) general categories. + +## Tabs + +Tabs in lines are not expanded to [spaces]. However, +in contexts where spaces help to define block structure, +tabs behave as if they were replaced by spaces with a tab stop +of 4 characters. + +Thus, for example, a tab can be used instead of four spaces +in an indented code block. (Note, however, that internal +tabs are passed through as literal tabs, not expanded to +spaces.) + +```````````````````````````````` example +→foo→baz→→bim +. +

foo→baz→→bim
+
+```````````````````````````````` + +```````````````````````````````` example + →foo→baz→→bim +. +
foo→baz→→bim
+
+```````````````````````````````` + +```````````````````````````````` example + a→a + ὐ→a +. +
a→a
+ὐ→a
+
+```````````````````````````````` + +In the following example, a continuation paragraph of a list +item is indented with a tab; this has exactly the same effect +as indentation with four spaces would: + +```````````````````````````````` example + - foo + +→bar +. +
    +
  • +

    foo

    +

    bar

    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo + +→→bar +. +
    +
  • +

    foo

    +
      bar
    +
    +
  • +
+```````````````````````````````` + +Normally the `>` that begins a block quote may be followed +optionally by a space, which is not considered part of the +content. In the following case `>` is followed by a tab, +which is treated as if it were expanded into three spaces. +Since one of these spaces is considered part of the +delimiter, `foo` is considered to be indented six spaces +inside the block quote context, so we get an indented +code block starting with two spaces. + +```````````````````````````````` example +>→→foo +. +
+
  foo
+
+
+```````````````````````````````` + +```````````````````````````````` example +-→→foo +. +
    +
  • +
      foo
    +
    +
  • +
+```````````````````````````````` + + +```````````````````````````````` example + foo +→bar +. +
foo
+bar
+
+```````````````````````````````` + +```````````````````````````````` example + - foo + - bar +→ - baz +. +
    +
  • foo +
      +
    • bar +
        +
      • baz
      • +
      +
    • +
    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +#→Foo +. +

Foo

+```````````````````````````````` + +```````````````````````````````` example +*→*→*→ +. +
+```````````````````````````````` + + +## Insecure characters + +For security reasons, the Unicode character `U+0000` must be replaced +with the REPLACEMENT CHARACTER (`U+FFFD`). + + +## Backslash escapes + +Any ASCII punctuation character may be backslash-escaped: + +```````````````````````````````` example +\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ +. +

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

+```````````````````````````````` + + +Backslashes before other characters are treated as literal +backslashes: + +```````````````````````````````` example +\→\A\a\ \3\φ\« +. +

\→\A\a\ \3\φ\«

+```````````````````````````````` + + +Escaped characters are treated as regular characters and do +not have their usual Markdown meanings: + +```````````````````````````````` example +\*not emphasized* +\
not a tag +\[not a link](/foo) +\`not code` +1\. not a list +\* not a list +\# not a heading +\[foo]: /url "not a reference" +\ö not a character entity +. +

*not emphasized* +<br/> not a tag +[not a link](/foo) +`not code` +1. not a list +* not a list +# not a heading +[foo]: /url "not a reference" +&ouml; not a character entity

+```````````````````````````````` + + +If a backslash is itself escaped, the following character is not: + +```````````````````````````````` example +\\*emphasis* +. +

\emphasis

+```````````````````````````````` + + +A backslash at the end of the line is a [hard line break]: + +```````````````````````````````` example +foo\ +bar +. +

foo
+bar

+```````````````````````````````` + + +Backslash escapes do not work in code blocks, code spans, autolinks, or +raw HTML: + +```````````````````````````````` example +`` \[\` `` +. +

\[\`

+```````````````````````````````` + + +```````````````````````````````` example + \[\] +. +
\[\]
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~ +\[\] +~~~ +. +
\[\]
+
+```````````````````````````````` + + +```````````````````````````````` example + +. +

https://example.com?find=\*

+```````````````````````````````` + + +```````````````````````````````` example + +. + +```````````````````````````````` + + +But they work in all other contexts, including URLs and link titles, +link references, and [info strings] in [fenced code blocks]: + +```````````````````````````````` example +[foo](/bar\* "ti\*tle") +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +[foo] + +[foo]: /bar\* "ti\*tle" +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +``` foo\+bar +foo +``` +. +
foo
+
+```````````````````````````````` + + +## Entity and numeric character references + +Valid HTML entity references and numeric character references +can be used in place of the corresponding Unicode character, +with the following exceptions: + +- Entity and character references are not recognized in code + blocks and code spans. + +- Entity and character references cannot stand in place of + special characters that define structural elements in + CommonMark. For example, although `*` can be used + in place of a literal `*` character, `*` cannot replace + `*` in emphasis delimiters, bullet list markers, or thematic + breaks. + +Conforming CommonMark parsers need not store information about +whether a particular character was represented in the source +using a Unicode character or an entity reference. + +[Entity references](@) consist of `&` + any of the valid +HTML5 entity names + `;`. The +document +is used as an authoritative source for the valid entity +references and their corresponding code points. + +```````````````````````````````` example +  & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸ +. +

  & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸

+```````````````````````````````` + + +[Decimal numeric character +references](@) +consist of `&#` + a string of 1--7 arabic digits + `;`. A +numeric character reference is parsed as the corresponding +Unicode character. Invalid Unicode code points will be replaced by +the REPLACEMENT CHARACTER (`U+FFFD`). For security reasons, +the code point `U+0000` will also be replaced by `U+FFFD`. + +```````````````````````````````` example +# Ӓ Ϡ � +. +

# Ӓ Ϡ �

+```````````````````````````````` + + +[Hexadecimal numeric character +references](@) consist of `&#` + +either `X` or `x` + a string of 1-6 hexadecimal digits + `;`. +They too are parsed as the corresponding Unicode character (this +time specified with a hexadecimal numeral instead of decimal). + +```````````````````````````````` example +" ആ ಫ +. +

" ആ ಫ

+```````````````````````````````` + + +Here are some nonentities: + +```````````````````````````````` example +  &x; &#; &#x; +� +&#abcdef0; +&ThisIsNotDefined; &hi?; +. +

&nbsp &x; &#; &#x; +&#87654321; +&#abcdef0; +&ThisIsNotDefined; &hi?;

+```````````````````````````````` + + +Although HTML5 does accept some entity references +without a trailing semicolon (such as `©`), these are not +recognized here, because it makes the grammar too ambiguous: + +```````````````````````````````` example +© +. +

&copy

+```````````````````````````````` + + +Strings that are not on the list of HTML5 named entities are not +recognized as entity references either: + +```````````````````````````````` example +&MadeUpEntity; +. +

&MadeUpEntity;

+```````````````````````````````` + + +Entity and numeric character references are recognized in any +context besides code spans or code blocks, including +URLs, [link titles], and [fenced code block][] [info strings]: + +```````````````````````````````` example + +. + +```````````````````````````````` + + +```````````````````````````````` example +[foo](/föö "föö") +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +[foo] + +[foo]: /föö "föö" +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +``` föö +foo +``` +. +
foo
+
+```````````````````````````````` + + +Entity and numeric character references are treated as literal +text in code spans and code blocks: + +```````````````````````````````` example +`föö` +. +

f&ouml;&ouml;

+```````````````````````````````` + + +```````````````````````````````` example + föfö +. +
f&ouml;f&ouml;
+
+```````````````````````````````` + + +Entity and numeric character references cannot be used +in place of symbols indicating structure in CommonMark +documents. + +```````````````````````````````` example +*foo* +*foo* +. +

*foo* +foo

+```````````````````````````````` + +```````````````````````````````` example +* foo + +* foo +. +

* foo

+
    +
  • foo
  • +
+```````````````````````````````` + +```````````````````````````````` example +foo bar +. +

foo + +bar

+```````````````````````````````` + +```````````````````````````````` example + foo +. +

→foo

+```````````````````````````````` + + +```````````````````````````````` example +[a](url "tit") +. +

[a](url "tit")

+```````````````````````````````` + + + +# Blocks and inlines + +We can think of a document as a sequence of +[blocks](@)---structural elements like paragraphs, block +quotations, lists, headings, rules, and code blocks. Some blocks (like +block quotes and list items) contain other blocks; others (like +headings and paragraphs) contain [inline](@) content---text, +links, emphasized text, images, code spans, and so on. + +## Precedence + +Indicators of block structure always take precedence over indicators +of inline structure. So, for example, the following is a list with +two items, not a list with one item containing a code span: + +```````````````````````````````` example +- `one +- two` +. +
    +
  • `one
  • +
  • two`
  • +
+```````````````````````````````` + + +This means that parsing can proceed in two steps: first, the block +structure of the document can be discerned; second, text lines inside +paragraphs, headings, and other block constructs can be parsed for inline +structure. The second step requires information about link reference +definitions that will be available only at the end of the first +step. Note that the first step requires processing lines in sequence, +but the second can be parallelized, since the inline parsing of +one block element does not affect the inline parsing of any other. + +## Container blocks and leaf blocks + +We can divide blocks into two types: +[container blocks](#container-blocks), +which can contain other blocks, and [leaf blocks](#leaf-blocks), +which cannot. + +# Leaf blocks + +This section describes the different kinds of leaf block that make up a +Markdown document. + +## Thematic breaks + +A line consisting of optionally up to three spaces of indentation, followed by a +sequence of three or more matching `-`, `_`, or `*` characters, each followed +optionally by any number of spaces or tabs, forms a +[thematic break](@). + +```````````````````````````````` example +*** +--- +___ +. +
+
+
+```````````````````````````````` + + +Wrong characters: + +```````````````````````````````` example ++++ +. +

+++

+```````````````````````````````` + + +```````````````````````````````` example +=== +. +

===

+```````````````````````````````` + + +Not enough characters: + +```````````````````````````````` example +-- +** +__ +. +

-- +** +__

+```````````````````````````````` + + +Up to three spaces of indentation are allowed: + +```````````````````````````````` example + *** + *** + *** +. +
+
+
+```````````````````````````````` + + +Four spaces of indentation is too many: + +```````````````````````````````` example + *** +. +
***
+
+```````````````````````````````` + + +```````````````````````````````` example +Foo + *** +. +

Foo +***

+```````````````````````````````` + + +More than three characters may be used: + +```````````````````````````````` example +_____________________________________ +. +
+```````````````````````````````` + + +Spaces and tabs are allowed between the characters: + +```````````````````````````````` example + - - - +. +
+```````````````````````````````` + + +```````````````````````````````` example + ** * ** * ** * ** +. +
+```````````````````````````````` + + +```````````````````````````````` example +- - - - +. +
+```````````````````````````````` + + +Spaces and tabs are allowed at the end: + +```````````````````````````````` example +- - - - +. +
+```````````````````````````````` + + +However, no other characters may occur in the line: + +```````````````````````````````` example +_ _ _ _ a + +a------ + +---a--- +. +

_ _ _ _ a

+

a------

+

---a---

+```````````````````````````````` + + +It is required that all of the characters other than spaces or tabs be the same. +So, this is not a thematic break: + +```````````````````````````````` example + *-* +. +

-

+```````````````````````````````` + + +Thematic breaks do not need blank lines before or after: + +```````````````````````````````` example +- foo +*** +- bar +. +
    +
  • foo
  • +
+
+
    +
  • bar
  • +
+```````````````````````````````` + + +Thematic breaks can interrupt a paragraph: + +```````````````````````````````` example +Foo +*** +bar +. +

Foo

+
+

bar

+```````````````````````````````` + + +If a line of dashes that meets the above conditions for being a +thematic break could also be interpreted as the underline of a [setext +heading], the interpretation as a +[setext heading] takes precedence. Thus, for example, +this is a setext heading, not a paragraph followed by a thematic break: + +```````````````````````````````` example +Foo +--- +bar +. +

Foo

+

bar

+```````````````````````````````` + + +When both a thematic break and a list item are possible +interpretations of a line, the thematic break takes precedence: + +```````````````````````````````` example +* Foo +* * * +* Bar +. +
    +
  • Foo
  • +
+
+
    +
  • Bar
  • +
+```````````````````````````````` + + +If you want a thematic break in a list item, use a different bullet: + +```````````````````````````````` example +- Foo +- * * * +. +
    +
  • Foo
  • +
  • +
    +
  • +
+```````````````````````````````` + + +## ATX headings + +An [ATX heading](@) +consists of a string of characters, parsed as inline content, between an +opening sequence of 1--6 unescaped `#` characters and an optional +closing sequence of any number of unescaped `#` characters. +The opening sequence of `#` characters must be followed by spaces or tabs, or +by the end of line. The optional closing sequence of `#`s must be preceded by +spaces or tabs and may be followed by spaces or tabs only. The opening +`#` character may be preceded by up to three spaces of indentation. The raw +contents of the heading are stripped of leading and trailing space or tabs +before being parsed as inline content. The heading level is equal to the number +of `#` characters in the opening sequence. + +Simple headings: + +```````````````````````````````` example +# foo +## foo +### foo +#### foo +##### foo +###### foo +. +

foo

+

foo

+

foo

+

foo

+
foo
+
foo
+```````````````````````````````` + + +More than six `#` characters is not a heading: + +```````````````````````````````` example +####### foo +. +

####### foo

+```````````````````````````````` + + +At least one space or tab is required between the `#` characters and the +heading's contents, unless the heading is empty. Note that many +implementations currently do not require the space. However, the +space was required by the +[original ATX implementation](http://www.aaronsw.com/2002/atx/atx.py), +and it helps prevent things like the following from being parsed as +headings: + +```````````````````````````````` example +#5 bolt + +#hashtag +. +

#5 bolt

+

#hashtag

+```````````````````````````````` + + +This is not a heading, because the first `#` is escaped: + +```````````````````````````````` example +\## foo +. +

## foo

+```````````````````````````````` + + +Contents are parsed as inlines: + +```````````````````````````````` example +# foo *bar* \*baz\* +. +

foo bar *baz*

+```````````````````````````````` + + +Leading and trailing spaces or tabs are ignored in parsing inline content: + +```````````````````````````````` example +# foo +. +

foo

+```````````````````````````````` + + +Up to three spaces of indentation are allowed: + +```````````````````````````````` example + ### foo + ## foo + # foo +. +

foo

+

foo

+

foo

+```````````````````````````````` + + +Four spaces of indentation is too many: + +```````````````````````````````` example + # foo +. +
# foo
+
+```````````````````````````````` + + +```````````````````````````````` example +foo + # bar +. +

foo +# bar

+```````````````````````````````` + + +A closing sequence of `#` characters is optional: + +```````````````````````````````` example +## foo ## + ### bar ### +. +

foo

+

bar

+```````````````````````````````` + + +It need not be the same length as the opening sequence: + +```````````````````````````````` example +# foo ################################## +##### foo ## +. +

foo

+
foo
+```````````````````````````````` + + +Spaces or tabs are allowed after the closing sequence: + +```````````````````````````````` example +### foo ### +. +

foo

+```````````````````````````````` + + +A sequence of `#` characters with anything but spaces or tabs following it +is not a closing sequence, but counts as part of the contents of the +heading: + +```````````````````````````````` example +### foo ### b +. +

foo ### b

+```````````````````````````````` + + +The closing sequence must be preceded by a space or tab: + +```````````````````````````````` example +# foo# +. +

foo#

+```````````````````````````````` + + +Backslash-escaped `#` characters do not count as part +of the closing sequence: + +```````````````````````````````` example +### foo \### +## foo #\## +# foo \# +. +

foo ###

+

foo ###

+

foo #

+```````````````````````````````` + + +ATX headings need not be separated from surrounding content by blank +lines, and they can interrupt paragraphs: + +```````````````````````````````` example +**** +## foo +**** +. +
+

foo

+
+```````````````````````````````` + + +```````````````````````````````` example +Foo bar +# baz +Bar foo +. +

Foo bar

+

baz

+

Bar foo

+```````````````````````````````` + + +ATX headings can be empty: + +```````````````````````````````` example +## +# +### ### +. +

+

+

+```````````````````````````````` + + +## Setext headings + +A [setext heading](@) consists of one or more +lines of text, not interrupted by a blank line, of which the first line does not +have more than 3 spaces of indentation, followed by +a [setext heading underline]. The lines of text must be such +that, were they not followed by the setext heading underline, +they would be interpreted as a paragraph: they cannot be +interpretable as a [code fence], [ATX heading][ATX headings], +[block quote][block quotes], [thematic break][thematic breaks], +[list item][list items], or [HTML block][HTML blocks]. + +A [setext heading underline](@) is a sequence of +`=` characters or a sequence of `-` characters, with no more than 3 +spaces of indentation and any number of trailing spaces or tabs. + +The heading is a level 1 heading if `=` characters are used in +the [setext heading underline], and a level 2 heading if `-` +characters are used. The contents of the heading are the result +of parsing the preceding lines of text as CommonMark inline +content. + +In general, a setext heading need not be preceded or followed by a +blank line. However, it cannot interrupt a paragraph, so when a +setext heading comes after a paragraph, a blank line is needed between +them. + +Simple examples: + +```````````````````````````````` example +Foo *bar* +========= + +Foo *bar* +--------- +. +

Foo bar

+

Foo bar

+```````````````````````````````` + + +The content of the header may span more than one line: + +```````````````````````````````` example +Foo *bar +baz* +==== +. +

Foo bar +baz

+```````````````````````````````` + +The contents are the result of parsing the headings's raw +content as inlines. The heading's raw content is formed by +concatenating the lines and removing initial and final +spaces or tabs. + +```````````````````````````````` example + Foo *bar +baz*→ +==== +. +

Foo bar +baz

+```````````````````````````````` + + +The underlining can be any length: + +```````````````````````````````` example +Foo +------------------------- + +Foo += +. +

Foo

+

Foo

+```````````````````````````````` + + +The heading content can be preceded by up to three spaces of indentation, and +need not line up with the underlining: + +```````````````````````````````` example + Foo +--- + + Foo +----- + + Foo + === +. +

Foo

+

Foo

+

Foo

+```````````````````````````````` + + +Four spaces of indentation is too many: + +```````````````````````````````` example + Foo + --- + + Foo +--- +. +
Foo
+---
+
+Foo
+
+
+```````````````````````````````` + + +The setext heading underline can be preceded by up to three spaces of +indentation, and may have trailing spaces or tabs: + +```````````````````````````````` example +Foo + ---- +. +

Foo

+```````````````````````````````` + + +Four spaces of indentation is too many: + +```````````````````````````````` example +Foo + --- +. +

Foo +---

+```````````````````````````````` + + +The setext heading underline cannot contain internal spaces or tabs: + +```````````````````````````````` example +Foo += = + +Foo +--- - +. +

Foo += =

+

Foo

+
+```````````````````````````````` + + +Trailing spaces or tabs in the content line do not cause a hard line break: + +```````````````````````````````` example +Foo +----- +. +

Foo

+```````````````````````````````` + + +Nor does a backslash at the end: + +```````````````````````````````` example +Foo\ +---- +. +

Foo\

+```````````````````````````````` + + +Since indicators of block structure take precedence over +indicators of inline structure, the following are setext headings: + +```````````````````````````````` example +`Foo +---- +` + + +. +

`Foo

+

`

+

<a title="a lot

+

of dashes"/>

+```````````````````````````````` + + +The setext heading underline cannot be a [lazy continuation +line] in a list item or block quote: + +```````````````````````````````` example +> Foo +--- +. +
+

Foo

+
+
+```````````````````````````````` + + +```````````````````````````````` example +> foo +bar +=== +. +
+

foo +bar +===

+
+```````````````````````````````` + + +```````````````````````````````` example +- Foo +--- +. +
    +
  • Foo
  • +
+
+```````````````````````````````` + + +A blank line is needed between a paragraph and a following +setext heading, since otherwise the paragraph becomes part +of the heading's content: + +```````````````````````````````` example +Foo +Bar +--- +. +

Foo +Bar

+```````````````````````````````` + + +But in general a blank line is not required before or after +setext headings: + +```````````````````````````````` example +--- +Foo +--- +Bar +--- +Baz +. +
+

Foo

+

Bar

+

Baz

+```````````````````````````````` + + +Setext headings cannot be empty: + +```````````````````````````````` example + +==== +. +

====

+```````````````````````````````` + + +Setext heading text lines must not be interpretable as block +constructs other than paragraphs. So, the line of dashes +in these examples gets interpreted as a thematic break: + +```````````````````````````````` example +--- +--- +. +
+
+```````````````````````````````` + + +```````````````````````````````` example +- foo +----- +. +
    +
  • foo
  • +
+
+```````````````````````````````` + + +```````````````````````````````` example + foo +--- +. +
foo
+
+
+```````````````````````````````` + + +```````````````````````````````` example +> foo +----- +. +
+

foo

+
+
+```````````````````````````````` + + +If you want a heading with `> foo` as its literal text, you can +use backslash escapes: + +```````````````````````````````` example +\> foo +------ +. +

> foo

+```````````````````````````````` + + +**Compatibility note:** Most existing Markdown implementations +do not allow the text of setext headings to span multiple lines. +But there is no consensus about how to interpret + +``` markdown +Foo +bar +--- +baz +``` + +One can find four different interpretations: + +1. paragraph "Foo", heading "bar", paragraph "baz" +2. paragraph "Foo bar", thematic break, paragraph "baz" +3. paragraph "Foo bar --- baz" +4. heading "Foo bar", paragraph "baz" + +We find interpretation 4 most natural, and interpretation 4 +increases the expressive power of CommonMark, by allowing +multiline headings. Authors who want interpretation 1 can +put a blank line after the first paragraph: + +```````````````````````````````` example +Foo + +bar +--- +baz +. +

Foo

+

bar

+

baz

+```````````````````````````````` + + +Authors who want interpretation 2 can put blank lines around +the thematic break, + +```````````````````````````````` example +Foo +bar + +--- + +baz +. +

Foo +bar

+
+

baz

+```````````````````````````````` + + +or use a thematic break that cannot count as a [setext heading +underline], such as + +```````````````````````````````` example +Foo +bar +* * * +baz +. +

Foo +bar

+
+

baz

+```````````````````````````````` + + +Authors who want interpretation 3 can use backslash escapes: + +```````````````````````````````` example +Foo +bar +\--- +baz +. +

Foo +bar +--- +baz

+```````````````````````````````` + + +## Indented code blocks + +An [indented code block](@) is composed of one or more +[indented chunks] separated by blank lines. +An [indented chunk](@) is a sequence of non-blank lines, +each preceded by four or more spaces of indentation. The contents of the code +block are the literal contents of the lines, including trailing +[line endings], minus four spaces of indentation. +An indented code block has no [info string]. + +An indented code block cannot interrupt a paragraph, so there must be +a blank line between a paragraph and a following indented code block. +(A blank line is not needed, however, between a code block and a following +paragraph.) + +```````````````````````````````` example + a simple + indented code block +. +
a simple
+  indented code block
+
+```````````````````````````````` + + +If there is any ambiguity between an interpretation of indentation +as a code block and as indicating that material belongs to a [list +item][list items], the list item interpretation takes precedence: + +```````````````````````````````` example + - foo + + bar +. +
    +
  • +

    foo

    +

    bar

    +
  • +
+```````````````````````````````` + + +```````````````````````````````` example +1. foo + + - bar +. +
    +
  1. +

    foo

    +
      +
    • bar
    • +
    +
  2. +
+```````````````````````````````` + + + +The contents of a code block are literal text, and do not get parsed +as Markdown: + +```````````````````````````````` example +
+ *hi* + + - one +. +
<a/>
+*hi*
+
+- one
+
+```````````````````````````````` + + +Here we have three chunks separated by blank lines: + +```````````````````````````````` example + chunk1 + + chunk2 + + + + chunk3 +. +
chunk1
+
+chunk2
+
+
+
+chunk3
+
+```````````````````````````````` + + +Any initial spaces or tabs beyond four spaces of indentation will be included in +the content, even in interior blank lines: + +```````````````````````````````` example + chunk1 + + chunk2 +. +
chunk1
+  
+  chunk2
+
+```````````````````````````````` + + +An indented code block cannot interrupt a paragraph. (This +allows hanging indents and the like.) + +```````````````````````````````` example +Foo + bar + +. +

Foo +bar

+```````````````````````````````` + + +However, any non-blank line with fewer than four spaces of indentation ends +the code block immediately. So a paragraph may occur immediately +after indented code: + +```````````````````````````````` example + foo +bar +. +
foo
+
+

bar

+```````````````````````````````` + + +And indented code can occur immediately before and after other kinds of +blocks: + +```````````````````````````````` example +# Heading + foo +Heading +------ + foo +---- +. +

Heading

+
foo
+
+

Heading

+
foo
+
+
+```````````````````````````````` + + +The first line can be preceded by more than four spaces of indentation: + +```````````````````````````````` example + foo + bar +. +
    foo
+bar
+
+```````````````````````````````` + + +Blank lines preceding or following an indented code block +are not included in it: + +```````````````````````````````` example + + + foo + + +. +
foo
+
+```````````````````````````````` + + +Trailing spaces or tabs are included in the code block's content: + +```````````````````````````````` example + foo +. +
foo  
+
+```````````````````````````````` + + + +## Fenced code blocks + +A [code fence](@) is a sequence +of at least three consecutive backtick characters (`` ` ``) or +tildes (`~`). (Tildes and backticks cannot be mixed.) +A [fenced code block](@) +begins with a code fence, preceded by up to three spaces of indentation. + +The line with the opening code fence may optionally contain some text +following the code fence; this is trimmed of leading and trailing +spaces or tabs and called the [info string](@). If the [info string] comes +after a backtick fence, it may not contain any backtick +characters. (The reason for this restriction is that otherwise +some inline code would be incorrectly interpreted as the +beginning of a fenced code block.) + +The content of the code block consists of all subsequent lines, until +a closing [code fence] of the same type as the code block +began with (backticks or tildes), and with at least as many backticks +or tildes as the opening code fence. If the leading code fence is +preceded by N spaces of indentation, then up to N spaces of indentation are +removed from each line of the content (if present). (If a content line is not +indented, it is preserved unchanged. If it is indented N spaces or less, all +of the indentation is removed.) + +The closing code fence may be preceded by up to three spaces of indentation, and +may be followed only by spaces or tabs, which are ignored. If the end of the +containing block (or document) is reached and no closing code fence +has been found, the code block contains all of the lines after the +opening code fence until the end of the containing block (or +document). (An alternative spec would require backtracking in the +event that a closing code fence is not found. But this makes parsing +much less efficient, and there seems to be no real downside to the +behavior described here.) + +A fenced code block may interrupt a paragraph, and does not require +a blank line either before or after. + +The content of a code fence is treated as literal text, not parsed +as inlines. The first word of the [info string] is typically used to +specify the language of the code sample, and rendered in the `class` +attribute of the `code` tag. However, this spec does not mandate any +particular treatment of the [info string]. + +Here is a simple example with backticks: + +```````````````````````````````` example +``` +< + > +``` +. +
<
+ >
+
+```````````````````````````````` + + +With tildes: + +```````````````````````````````` example +~~~ +< + > +~~~ +. +
<
+ >
+
+```````````````````````````````` + +Fewer than three backticks is not enough: + +```````````````````````````````` example +`` +foo +`` +. +

foo

+```````````````````````````````` + +The closing code fence must use the same character as the opening +fence: + +```````````````````````````````` example +``` +aaa +~~~ +``` +. +
aaa
+~~~
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~ +aaa +``` +~~~ +. +
aaa
+```
+
+```````````````````````````````` + + +The closing code fence must be at least as long as the opening fence: + +```````````````````````````````` example +```` +aaa +``` +`````` +. +
aaa
+```
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~~ +aaa +~~~ +~~~~ +. +
aaa
+~~~
+
+```````````````````````````````` + + +Unclosed code blocks are closed by the end of the document +(or the enclosing [block quote][block quotes] or [list item][list items]): + +```````````````````````````````` example +``` +. +
+```````````````````````````````` + + +```````````````````````````````` example +````` + +``` +aaa +. +

+```
+aaa
+
+```````````````````````````````` + + +```````````````````````````````` example +> ``` +> aaa + +bbb +. +
+
aaa
+
+
+

bbb

+```````````````````````````````` + + +A code block can have all empty lines as its content: + +```````````````````````````````` example +``` + + +``` +. +

+  
+
+```````````````````````````````` + + +A code block can be empty: + +```````````````````````````````` example +``` +``` +. +
+```````````````````````````````` + + +Fences can be indented. If the opening fence is indented, +content lines will have equivalent opening indentation removed, +if present: + +```````````````````````````````` example + ``` + aaa +aaa +``` +. +
aaa
+aaa
+
+```````````````````````````````` + + +```````````````````````````````` example + ``` +aaa + aaa +aaa + ``` +. +
aaa
+aaa
+aaa
+
+```````````````````````````````` + + +```````````````````````````````` example + ``` + aaa + aaa + aaa + ``` +. +
aaa
+ aaa
+aaa
+
+```````````````````````````````` + + +Four spaces of indentation is too many: + +```````````````````````````````` example + ``` + aaa + ``` +. +
```
+aaa
+```
+
+```````````````````````````````` + + +Closing fences may be preceded by up to three spaces of indentation, and their +indentation need not match that of the opening fence: + +```````````````````````````````` example +``` +aaa + ``` +. +
aaa
+
+```````````````````````````````` + + +```````````````````````````````` example + ``` +aaa + ``` +. +
aaa
+
+```````````````````````````````` + + +This is not a closing fence, because it is indented 4 spaces: + +```````````````````````````````` example +``` +aaa + ``` +. +
aaa
+    ```
+
+```````````````````````````````` + + + +Code fences (opening and closing) cannot contain internal spaces or tabs: + +```````````````````````````````` example +``` ``` +aaa +. +

+aaa

+```````````````````````````````` + + +```````````````````````````````` example +~~~~~~ +aaa +~~~ ~~ +. +
aaa
+~~~ ~~
+
+```````````````````````````````` + + +Fenced code blocks can interrupt paragraphs, and can be followed +directly by paragraphs, without a blank line between: + +```````````````````````````````` example +foo +``` +bar +``` +baz +. +

foo

+
bar
+
+

baz

+```````````````````````````````` + + +Other blocks can also occur before and after fenced code blocks +without an intervening blank line: + +```````````````````````````````` example +foo +--- +~~~ +bar +~~~ +# baz +. +

foo

+
bar
+
+

baz

+```````````````````````````````` + + +An [info string] can be provided after the opening code fence. +Although this spec doesn't mandate any particular treatment of +the info string, the first word is typically used to specify +the language of the code block. In HTML output, the language is +normally indicated by adding a class to the `code` element consisting +of `language-` followed by the language name. + +```````````````````````````````` example +```ruby +def foo(x) + return 3 +end +``` +. +
def foo(x)
+  return 3
+end
+
+```````````````````````````````` + + +```````````````````````````````` example +~~~~ ruby startline=3 $%@#$ +def foo(x) + return 3 +end +~~~~~~~ +. +
def foo(x)
+  return 3
+end
+
+```````````````````````````````` + + +```````````````````````````````` example +````; +```` +. +
+```````````````````````````````` + + +[Info strings] for backtick code blocks cannot contain backticks: + +```````````````````````````````` example +``` aa ``` +foo +. +

aa +foo

+```````````````````````````````` + + +[Info strings] for tilde code blocks can contain backticks and tildes: + +```````````````````````````````` example +~~~ aa ``` ~~~ +foo +~~~ +. +
foo
+
+```````````````````````````````` + + +Closing code fences cannot have [info strings]: + +```````````````````````````````` example +``` +``` aaa +``` +. +
``` aaa
+
+```````````````````````````````` + + + +## HTML blocks + +An [HTML block](@) is a group of lines that is treated +as raw HTML (and will not be escaped in HTML output). + +There are seven kinds of [HTML block], which can be defined by their +start and end conditions. The block begins with a line that meets a +[start condition](@) (after up to three optional spaces of indentation). +It ends with the first subsequent line that meets a matching +[end condition](@), or the last line of the document, or the last line of +the [container block](#container-blocks) containing the current HTML +block, if no line is encountered that meets the [end condition]. If +the first line meets both the [start condition] and the [end +condition], the block will contain just that line. + +1. **Start condition:** line begins with the string ``, or the end of the line.\ +**End condition:** line contains an end tag +``, ``, ``, or `` (case-insensitive; it +need not match the start tag). + +2. **Start condition:** line begins with the string ``. + +3. **Start condition:** line begins with the string ``. + +4. **Start condition:** line begins with the string ``. + +5. **Start condition:** line begins with the string +``. + +6. **Start condition:** line begins with the string `<` or ``, or +the string `/>`.\ +**End condition:** line is followed by a [blank line]. + +7. **Start condition:** line begins with a complete [open tag] +(with any [tag name] other than `pre`, `script`, +`style`, or `textarea`) or a complete [closing tag], +followed by zero or more spaces and tabs, followed by the end of the line.\ +**End condition:** line is followed by a [blank line]. + +HTML blocks continue until they are closed by their appropriate +[end condition], or the last line of the document or other [container +block](#container-blocks). This means any HTML **within an HTML +block** that might otherwise be recognised as a start condition will +be ignored by the parser and passed through as-is, without changing +the parser's state. + +For instance, `
` within an HTML block started by `` will not affect
+the parser state; as the HTML block was started in by start condition 6, it
+will end at any blank line. This can be surprising:
+
+```````````````````````````````` example
+
+
+**Hello**,
+
+_world_.
+
+
+. +
+
+**Hello**,
+

world. +

+
+```````````````````````````````` + +In this case, the HTML block is terminated by the blank line — the `**Hello**` +text remains verbatim — and regular parsing resumes, with a paragraph, +emphasised `world` and inline and block HTML following. + +All types of [HTML blocks] except type 7 may interrupt +a paragraph. Blocks of type 7 may not interrupt a paragraph. +(This restriction is intended to prevent unwanted interpretation +of long tags inside a wrapped paragraph as starting HTML blocks.) + +Some simple examples follow. Here are some basic HTML blocks +of type 6: + +```````````````````````````````` example + + + + +
+ hi +
+ +okay. +. + + + + +
+ hi +
+

okay.

+```````````````````````````````` + + +```````````````````````````````` example +
+*foo* +```````````````````````````````` + + +Here we have two HTML blocks with a Markdown paragraph between them: + +```````````````````````````````` example +
+ +*Markdown* + +
+. +
+

Markdown

+
+```````````````````````````````` + + +The tag on the first line can be partial, as long +as it is split where there would be whitespace: + +```````````````````````````````` example +
+
+. +
+
+```````````````````````````````` + + +```````````````````````````````` example +
+
+. +
+
+```````````````````````````````` + + +An open tag need not be closed: +```````````````````````````````` example +
+*foo* + +*bar* +. +
+*foo* +

bar

+```````````````````````````````` + + + +A partial tag need not even be completed (garbage +in, garbage out): + +```````````````````````````````` example +
+. + +```````````````````````````````` + + +```````````````````````````````` example +
+foo +
+. +
+foo +
+```````````````````````````````` + + +Everything until the next blank line or end of document +gets included in the HTML block. So, in the following +example, what looks like a Markdown code block +is actually part of the HTML block, which continues until a blank +line or the end of the document is reached: + +```````````````````````````````` example +
+``` c +int x = 33; +``` +. +
+``` c +int x = 33; +``` +```````````````````````````````` + + +To start an [HTML block] with a tag that is *not* in the +list of block-level tags in (6), you must put the tag by +itself on the first line (and it must be complete): + +```````````````````````````````` example + +*bar* + +. + +*bar* + +```````````````````````````````` + + +In type 7 blocks, the [tag name] can be anything: + +```````````````````````````````` example + +*bar* + +. + +*bar* + +```````````````````````````````` + + +```````````````````````````````` example + +*bar* + +. + +*bar* + +```````````````````````````````` + + +```````````````````````````````` example + +*bar* +. + +*bar* +```````````````````````````````` + + +These rules are designed to allow us to work with tags that +can function as either block-level or inline-level tags. +The `` tag is a nice example. We can surround content with +`` tags in three different ways. In this case, we get a raw +HTML block, because the `` tag is on a line by itself: + +```````````````````````````````` example + +*foo* + +. + +*foo* + +```````````````````````````````` + + +In this case, we get a raw HTML block that just includes +the `` tag (because it ends with the following blank +line). So the contents get interpreted as CommonMark: + +```````````````````````````````` example + + +*foo* + + +. + +

foo

+
+```````````````````````````````` + + +Finally, in this case, the `` tags are interpreted +as [raw HTML] *inside* the CommonMark paragraph. (Because +the tag is not on a line by itself, we get inline HTML +rather than an [HTML block].) + +```````````````````````````````` example +*foo* +. +

foo

+```````````````````````````````` + + +HTML tags designed to contain literal content +(`pre`, `script`, `style`, `textarea`), comments, processing instructions, +and declarations are treated somewhat differently. +Instead of ending at the first blank line, these blocks +end at the first line containing a corresponding end tag. +As a result, these blocks can contain blank lines: + +A pre tag (type 1): + +```````````````````````````````` example +

+import Text.HTML.TagSoup
+
+main :: IO ()
+main = print $ parseTags tags
+
+okay +. +

+import Text.HTML.TagSoup
+
+main :: IO ()
+main = print $ parseTags tags
+
+

okay

+```````````````````````````````` + + +A script tag (type 1): + +```````````````````````````````` example + +okay +. + +

okay

+```````````````````````````````` + + +A textarea tag (type 1): + +```````````````````````````````` example + +. + +```````````````````````````````` + +A style tag (type 1): + +```````````````````````````````` example + +okay +. + +

okay

+```````````````````````````````` + + +If there is no matching end tag, the block will end at the +end of the document (or the enclosing [block quote][block quotes] +or [list item][list items]): + +```````````````````````````````` example + +*foo* +. + +

foo

+```````````````````````````````` + + +```````````````````````````````` example +*bar* +*baz* +. +*bar* +

baz

+```````````````````````````````` + + +Note that anything on the last line after the +end tag will be included in the [HTML block]: + +```````````````````````````````` example +1. *bar* +. +1. *bar* +```````````````````````````````` + + +A comment (type 2): + +```````````````````````````````` example + +okay +. + +

okay

+```````````````````````````````` + + + +A processing instruction (type 3): + +```````````````````````````````` example +'; + +?> +okay +. +'; + +?> +

okay

+```````````````````````````````` + + +A declaration (type 4): + +```````````````````````````````` example + +. + +```````````````````````````````` + + +CDATA (type 5): + +```````````````````````````````` example + +okay +. + +

okay

+```````````````````````````````` + + +The opening tag can be preceded by up to three spaces of indentation, but not +four: + +```````````````````````````````` example + + + +. + +
<!-- foo -->
+
+```````````````````````````````` + + +```````````````````````````````` example +
+ +
+. +
+
<div>
+
+```````````````````````````````` + + +An HTML block of types 1--6 can interrupt a paragraph, and need not be +preceded by a blank line. + +```````````````````````````````` example +Foo +
+bar +
+. +

Foo

+
+bar +
+```````````````````````````````` + + +However, a following blank line is needed, except at the end of +a document, and except for blocks of types 1--5, [above][HTML +block]: + +```````````````````````````````` example +
+bar +
+*foo* +. +
+bar +
+*foo* +```````````````````````````````` + + +HTML blocks of type 7 cannot interrupt a paragraph: + +```````````````````````````````` example +Foo + +baz +. +

Foo + +baz

+```````````````````````````````` + + +This rule differs from John Gruber's original Markdown syntax +specification, which says: + +> The only restrictions are that block-level HTML elements — +> e.g. `
`, ``, `
`, `

`, etc. — must be separated from +> surrounding content by blank lines, and the start and end tags of the +> block should not be indented with spaces or tabs. + +In some ways Gruber's rule is more restrictive than the one given +here: + +- It requires that an HTML block be preceded by a blank line. +- It does not allow the start tag to be indented. +- It requires a matching end tag, which it also does not allow to + be indented. + +Most Markdown implementations (including some of Gruber's own) do not +respect all of these restrictions. + +There is one respect, however, in which Gruber's rule is more liberal +than the one given here, since it allows blank lines to occur inside +an HTML block. There are two reasons for disallowing them here. +First, it removes the need to parse balanced tags, which is +expensive and can require backtracking from the end of the document +if no matching end tag is found. Second, it provides a very simple +and flexible way of including Markdown content inside HTML tags: +simply separate the Markdown from the HTML using blank lines: + +Compare: + +```````````````````````````````` example +

+ +*Emphasized* text. + +
+. +
+

Emphasized text.

+
+```````````````````````````````` + + +```````````````````````````````` example +
+*Emphasized* text. +
+. +
+*Emphasized* text. +
+```````````````````````````````` + + +Some Markdown implementations have adopted a convention of +interpreting content inside tags as text if the open tag has +the attribute `markdown=1`. The rule given above seems a simpler and +more elegant way of achieving the same expressive power, which is also +much simpler to parse. + +The main potential drawback is that one can no longer paste HTML +blocks into Markdown documents with 100% reliability. However, +*in most cases* this will work fine, because the blank lines in +HTML are usually followed by HTML block tags. For example: + +```````````````````````````````` example +
+ + + + + + + +
+Hi +
+. + + + + +
+Hi +
+```````````````````````````````` + + +There are problems, however, if the inner tags are indented +*and* separated by spaces, as then they will be interpreted as +an indented code block: + +```````````````````````````````` example + + + + + + + + +
+ Hi +
+. + + +
<td>
+  Hi
+</td>
+
+ +
+```````````````````````````````` + + +Fortunately, blank lines are usually not necessary and can be +deleted. The exception is inside `
` tags, but as described
+[above][HTML blocks], raw HTML blocks starting with `
`
+*can* contain blank lines.
+
+## Link reference definitions
+
+A [link reference definition](@)
+consists of a [link label], optionally preceded by up to three spaces of
+indentation, followed
+by a colon (`:`), optional spaces or tabs (including up to one
+[line ending]), a [link destination],
+optional spaces or tabs (including up to one
+[line ending]), and an optional [link
+title], which if it is present must be separated
+from the [link destination] by spaces or tabs.
+No further character may occur.
+
+A [link reference definition]
+does not correspond to a structural element of a document.  Instead, it
+defines a label which can be used in [reference links]
+and reference-style [images] elsewhere in the document.  [Link
+reference definitions] can come either before or after the links that use
+them.
+
+```````````````````````````````` example
+[foo]: /url "title"
+
+[foo]
+.
+

foo

+```````````````````````````````` + + +```````````````````````````````` example + [foo]: + /url + 'the title' + +[foo] +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +[Foo*bar\]]:my_(url) 'title (with parens)' + +[Foo*bar\]] +. +

Foo*bar]

+```````````````````````````````` + + +```````````````````````````````` example +[Foo bar]: + +'title' + +[Foo bar] +. +

Foo bar

+```````````````````````````````` + + +The title may extend over multiple lines: + +```````````````````````````````` example +[foo]: /url ' +title +line1 +line2 +' + +[foo] +. +

foo

+```````````````````````````````` + + +However, it may not contain a [blank line]: + +```````````````````````````````` example +[foo]: /url 'title + +with blank line' + +[foo] +. +

[foo]: /url 'title

+

with blank line'

+

[foo]

+```````````````````````````````` + + +The title may be omitted: + +```````````````````````````````` example +[foo]: +/url + +[foo] +. +

foo

+```````````````````````````````` + + +The link destination may not be omitted: + +```````````````````````````````` example +[foo]: + +[foo] +. +

[foo]:

+

[foo]

+```````````````````````````````` + + However, an empty link destination may be specified using + angle brackets: + +```````````````````````````````` example +[foo]: <> + +[foo] +. +

foo

+```````````````````````````````` + +The title must be separated from the link destination by +spaces or tabs: + +```````````````````````````````` example +[foo]: (baz) + +[foo] +. +

[foo]: (baz)

+

[foo]

+```````````````````````````````` + + +Both title and destination can contain backslash escapes +and literal backslashes: + +```````````````````````````````` example +[foo]: /url\bar\*baz "foo\"bar\baz" + +[foo] +. +

foo

+```````````````````````````````` + + +A link can come before its corresponding definition: + +```````````````````````````````` example +[foo] + +[foo]: url +. +

foo

+```````````````````````````````` + + +If there are several matching definitions, the first one takes +precedence: + +```````````````````````````````` example +[foo] + +[foo]: first +[foo]: second +. +

foo

+```````````````````````````````` + + +As noted in the section on [Links], matching of labels is +case-insensitive (see [matches]). + +```````````````````````````````` example +[FOO]: /url + +[Foo] +. +

Foo

+```````````````````````````````` + + +```````````````````````````````` example +[ΑΓΩ]: /φου + +[αγω] +. +

αγω

+```````````````````````````````` + + +Whether something is a [link reference definition] is +independent of whether the link reference it defines is +used in the document. Thus, for example, the following +document contains just a link reference definition, and +no visible content: + +```````````````````````````````` example +[foo]: /url +. +```````````````````````````````` + + +Here is another one: + +```````````````````````````````` example +[ +foo +]: /url +bar +. +

bar

+```````````````````````````````` + + +This is not a link reference definition, because there are +characters other than spaces or tabs after the title: + +```````````````````````````````` example +[foo]: /url "title" ok +. +

[foo]: /url "title" ok

+```````````````````````````````` + + +This is a link reference definition, but it has no title: + +```````````````````````````````` example +[foo]: /url +"title" ok +. +

"title" ok

+```````````````````````````````` + + +This is not a link reference definition, because it is indented +four spaces: + +```````````````````````````````` example + [foo]: /url "title" + +[foo] +. +
[foo]: /url "title"
+
+

[foo]

+```````````````````````````````` + + +This is not a link reference definition, because it occurs inside +a code block: + +```````````````````````````````` example +``` +[foo]: /url +``` + +[foo] +. +
[foo]: /url
+
+

[foo]

+```````````````````````````````` + + +A [link reference definition] cannot interrupt a paragraph. + +```````````````````````````````` example +Foo +[bar]: /baz + +[bar] +. +

Foo +[bar]: /baz

+

[bar]

+```````````````````````````````` + + +However, it can directly follow other block elements, such as headings +and thematic breaks, and it need not be followed by a blank line. + +```````````````````````````````` example +# [Foo] +[foo]: /url +> bar +. +

Foo

+
+

bar

+
+```````````````````````````````` + +```````````````````````````````` example +[foo]: /url +bar +=== +[foo] +. +

bar

+

foo

+```````````````````````````````` + +```````````````````````````````` example +[foo]: /url +=== +[foo] +. +

=== +foo

+```````````````````````````````` + + +Several [link reference definitions] +can occur one after another, without intervening blank lines. + +```````````````````````````````` example +[foo]: /foo-url "foo" +[bar]: /bar-url + "bar" +[baz]: /baz-url + +[foo], +[bar], +[baz] +. +

foo, +bar, +baz

+```````````````````````````````` + + +[Link reference definitions] can occur +inside block containers, like lists and block quotations. They +affect the entire document, not just the container in which they +are defined: + +```````````````````````````````` example +[foo] + +> [foo]: /url +. +

foo

+
+
+```````````````````````````````` + + +## Paragraphs + +A sequence of non-blank lines that cannot be interpreted as other +kinds of blocks forms a [paragraph](@). +The contents of the paragraph are the result of parsing the +paragraph's raw content as inlines. The paragraph's raw content +is formed by concatenating the lines and removing initial and final +spaces or tabs. + +A simple example with two paragraphs: + +```````````````````````````````` example +aaa + +bbb +. +

aaa

+

bbb

+```````````````````````````````` + + +Paragraphs can contain multiple lines, but no blank lines: + +```````````````````````````````` example +aaa +bbb + +ccc +ddd +. +

aaa +bbb

+

ccc +ddd

+```````````````````````````````` + + +Multiple blank lines between paragraphs have no effect: + +```````````````````````````````` example +aaa + + +bbb +. +

aaa

+

bbb

+```````````````````````````````` + + +Leading spaces or tabs are skipped: + +```````````````````````````````` example + aaa + bbb +. +

aaa +bbb

+```````````````````````````````` + + +Lines after the first may be indented any amount, since indented +code blocks cannot interrupt paragraphs. + +```````````````````````````````` example +aaa + bbb + ccc +. +

aaa +bbb +ccc

+```````````````````````````````` + + +However, the first line may be preceded by up to three spaces of indentation. +Four spaces of indentation is too many: + +```````````````````````````````` example + aaa +bbb +. +

aaa +bbb

+```````````````````````````````` + + +```````````````````````````````` example + aaa +bbb +. +
aaa
+
+

bbb

+```````````````````````````````` + + +Final spaces or tabs are stripped before inline parsing, so a paragraph +that ends with two or more spaces will not end with a [hard line +break]: + +```````````````````````````````` example +aaa +bbb +. +

aaa
+bbb

+```````````````````````````````` + + +## Blank lines + +[Blank lines] between block-level elements are ignored, +except for the role they play in determining whether a [list] +is [tight] or [loose]. + +Blank lines at the beginning and end of the document are also ignored. + +```````````````````````````````` example + + +aaa + + +# aaa + + +. +

aaa

+

aaa

+```````````````````````````````` + + + +# Container blocks + +A [container block](#container-blocks) is a block that has other +blocks as its contents. There are two basic kinds of container blocks: +[block quotes] and [list items]. +[Lists] are meta-containers for [list items]. + +We define the syntax for container blocks recursively. The general +form of the definition is: + +> If X is a sequence of blocks, then the result of +> transforming X in such-and-such a way is a container of type Y +> with these blocks as its content. + +So, we explain what counts as a block quote or list item by explaining +how these can be *generated* from their contents. This should suffice +to define the syntax, although it does not give a recipe for *parsing* +these constructions. (A recipe is provided below in the section entitled +[A parsing strategy](#appendix-a-parsing-strategy).) + +## Block quotes + +A [block quote marker](@), +optionally preceded by up to three spaces of indentation, +consists of (a) the character `>` together with a following space of +indentation, or (b) a single character `>` not followed by a space of +indentation. + +The following rules define [block quotes]: + +1. **Basic case.** If a string of lines *Ls* constitute a sequence + of blocks *Bs*, then the result of prepending a [block quote + marker] to the beginning of each line in *Ls* + is a [block quote](#block-quotes) containing *Bs*. + +2. **Laziness.** If a string of lines *Ls* constitute a [block + quote](#block-quotes) with contents *Bs*, then the result of deleting + the initial [block quote marker] from one or + more lines in which the next character other than a space or tab after the + [block quote marker] is [paragraph continuation + text] is a block quote with *Bs* as its content. + [Paragraph continuation text](@) is text + that will be parsed as part of the content of a paragraph, but does + not occur at the beginning of the paragraph. + +3. **Consecutiveness.** A document cannot contain two [block + quotes] in a row unless there is a [blank line] between them. + +Nothing else counts as a [block quote](#block-quotes). + +Here is a simple example: + +```````````````````````````````` example +> # Foo +> bar +> baz +. +
+

Foo

+

bar +baz

+
+```````````````````````````````` + + +The space or tab after the `>` characters can be omitted: + +```````````````````````````````` example +># Foo +>bar +> baz +. +
+

Foo

+

bar +baz

+
+```````````````````````````````` + + +The `>` characters can be preceded by up to three spaces of indentation: + +```````````````````````````````` example + > # Foo + > bar + > baz +. +
+

Foo

+

bar +baz

+
+```````````````````````````````` + + +Four spaces of indentation is too many: + +```````````````````````````````` example + > # Foo + > bar + > baz +. +
> # Foo
+> bar
+> baz
+
+```````````````````````````````` + + +The Laziness clause allows us to omit the `>` before +[paragraph continuation text]: + +```````````````````````````````` example +> # Foo +> bar +baz +. +
+

Foo

+

bar +baz

+
+```````````````````````````````` + + +A block quote can contain some lazy and some non-lazy +continuation lines: + +```````````````````````````````` example +> bar +baz +> foo +. +
+

bar +baz +foo

+
+```````````````````````````````` + + +Laziness only applies to lines that would have been continuations of +paragraphs had they been prepended with [block quote markers]. +For example, the `> ` cannot be omitted in the second line of + +``` markdown +> foo +> --- +``` + +without changing the meaning: + +```````````````````````````````` example +> foo +--- +. +
+

foo

+
+
+```````````````````````````````` + + +Similarly, if we omit the `> ` in the second line of + +``` markdown +> - foo +> - bar +``` + +then the block quote ends after the first line: + +```````````````````````````````` example +> - foo +- bar +. +
+
    +
  • foo
  • +
+
+
    +
  • bar
  • +
+```````````````````````````````` + + +For the same reason, we can't omit the `> ` in front of +subsequent lines of an indented or fenced code block: + +```````````````````````````````` example +> foo + bar +. +
+
foo
+
+
+
bar
+
+```````````````````````````````` + + +```````````````````````````````` example +> ``` +foo +``` +. +
+
+
+

foo

+
+```````````````````````````````` + + +Note that in the following case, we have a [lazy +continuation line]: + +```````````````````````````````` example +> foo + - bar +. +
+

foo +- bar

+
+```````````````````````````````` + + +To see why, note that in + +```markdown +> foo +> - bar +``` + +the `- bar` is indented too far to start a list, and can't +be an indented code block because indented code blocks cannot +interrupt paragraphs, so it is [paragraph continuation text]. + +A block quote can be empty: + +```````````````````````````````` example +> +. +
+
+```````````````````````````````` + + +```````````````````````````````` example +> +> +> +. +
+
+```````````````````````````````` + + +A block quote can have initial or final blank lines: + +```````````````````````````````` example +> +> foo +> +. +
+

foo

+
+```````````````````````````````` + + +A blank line always separates block quotes: + +```````````````````````````````` example +> foo + +> bar +. +
+

foo

+
+
+

bar

+
+```````````````````````````````` + + +(Most current Markdown implementations, including John Gruber's +original `Markdown.pl`, will parse this example as a single block quote +with two paragraphs. But it seems better to allow the author to decide +whether two block quotes or one are wanted.) + +Consecutiveness means that if we put these block quotes together, +we get a single block quote: + +```````````````````````````````` example +> foo +> bar +. +
+

foo +bar

+
+```````````````````````````````` + + +To get a block quote with two paragraphs, use: + +```````````````````````````````` example +> foo +> +> bar +. +
+

foo

+

bar

+
+```````````````````````````````` + + +Block quotes can interrupt paragraphs: + +```````````````````````````````` example +foo +> bar +. +

foo

+
+

bar

+
+```````````````````````````````` + + +In general, blank lines are not needed before or after block +quotes: + +```````````````````````````````` example +> aaa +*** +> bbb +. +
+

aaa

+
+
+
+

bbb

+
+```````````````````````````````` + + +However, because of laziness, a blank line is needed between +a block quote and a following paragraph: + +```````````````````````````````` example +> bar +baz +. +
+

bar +baz

+
+```````````````````````````````` + + +```````````````````````````````` example +> bar + +baz +. +
+

bar

+
+

baz

+```````````````````````````````` + + +```````````````````````````````` example +> bar +> +baz +. +
+

bar

+
+

baz

+```````````````````````````````` + + +It is a consequence of the Laziness rule that any number +of initial `>`s may be omitted on a continuation line of a +nested block quote: + +```````````````````````````````` example +> > > foo +bar +. +
+
+
+

foo +bar

+
+
+
+```````````````````````````````` + + +```````````````````````````````` example +>>> foo +> bar +>>baz +. +
+
+
+

foo +bar +baz

+
+
+
+```````````````````````````````` + + +When including an indented code block in a block quote, +remember that the [block quote marker] includes +both the `>` and a following space of indentation. So *five spaces* are needed +after the `>`: + +```````````````````````````````` example +> code + +> not code +. +
+
code
+
+
+
+

not code

+
+```````````````````````````````` + + + +## List items + +A [list marker](@) is a +[bullet list marker] or an [ordered list marker]. + +A [bullet list marker](@) +is a `-`, `+`, or `*` character. + +An [ordered list marker](@) +is a sequence of 1--9 arabic digits (`0-9`), followed by either a +`.` character or a `)` character. (The reason for the length +limit is that with 10 digits we start seeing integer overflows +in some browsers.) + +The following rules define [list items]: + +1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of + blocks *Bs* starting with a character other than a space or tab, and *M* is + a list marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces of indentation, + then the result of prepending *M* and the following spaces to the first line + of *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a + list item with *Bs* as its contents. The type of the list item + (bullet or ordered) is determined by the type of its list marker. + If the list item is ordered, then it is also assigned a start + number, based on the ordered list marker. + + Exceptions: + + 1. When the first list item in a [list] interrupts + a paragraph---that is, when it starts on a line that would + otherwise count as [paragraph continuation text]---then (a) + the lines *Ls* must not begin with a blank line, and (b) if + the list item is ordered, the start number must be 1. + 2. If any line is a [thematic break][thematic breaks] then + that line is not a list item. + +For example, let *Ls* be the lines + +```````````````````````````````` example +A paragraph +with two lines. + + indented code + +> A block quote. +. +

A paragraph +with two lines.

+
indented code
+
+
+

A block quote.

+
+```````````````````````````````` + + +And let *M* be the marker `1.`, and *N* = 2. Then rule #1 says +that the following is an ordered list item with start number 1, +and the same contents as *Ls*: + +```````````````````````````````` example +1. A paragraph + with two lines. + + indented code + + > A block quote. +. +
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+```````````````````````````````` + + +The most important thing to notice is that the position of +the text after the list marker determines how much indentation +is needed in subsequent blocks in the list item. If the list +marker takes up two spaces of indentation, and there are three spaces between +the list marker and the next character other than a space or tab, then blocks +must be indented five spaces in order to fall under the list +item. + +Here are some examples showing how far content must be indented to be +put under the list item: + +```````````````````````````````` example +- one + + two +. +
    +
  • one
  • +
+

two

+```````````````````````````````` + + +```````````````````````````````` example +- one + + two +. +
    +
  • +

    one

    +

    two

    +
  • +
+```````````````````````````````` + + +```````````````````````````````` example + - one + + two +. +
    +
  • one
  • +
+
 two
+
+```````````````````````````````` + + +```````````````````````````````` example + - one + + two +. +
    +
  • +

    one

    +

    two

    +
  • +
+```````````````````````````````` + + +It is tempting to think of this in terms of columns: the continuation +blocks must be indented at least to the column of the first character other than +a space or tab after the list marker. However, that is not quite right. +The spaces of indentation after the list marker determine how much relative +indentation is needed. Which column this indentation reaches will depend on +how the list item is embedded in other constructions, as shown by +this example: + +```````````````````````````````` example + > > 1. one +>> +>> two +. +
+
+
    +
  1. +

    one

    +

    two

    +
  2. +
+
+
+```````````````````````````````` + + +Here `two` occurs in the same column as the list marker `1.`, +but is actually contained in the list item, because there is +sufficient indentation after the last containing blockquote marker. + +The converse is also possible. In the following example, the word `two` +occurs far to the right of the initial text of the list item, `one`, but +it is not considered part of the list item, because it is not indented +far enough past the blockquote marker: + +```````````````````````````````` example +>>- one +>> + > > two +. +
+
+
    +
  • one
  • +
+

two

+
+
+```````````````````````````````` + + +Note that at least one space or tab is needed between the list marker and +any following content, so these are not list items: + +```````````````````````````````` example +-one + +2.two +. +

-one

+

2.two

+```````````````````````````````` + + +A list item may contain blocks that are separated by more than +one blank line. + +```````````````````````````````` example +- foo + + + bar +. +
    +
  • +

    foo

    +

    bar

    +
  • +
+```````````````````````````````` + + +A list item may contain any kind of block: + +```````````````````````````````` example +1. foo + + ``` + bar + ``` + + baz + + > bam +. +
    +
  1. +

    foo

    +
    bar
    +
    +

    baz

    +
    +

    bam

    +
    +
  2. +
+```````````````````````````````` + + +A list item that contains an indented code block will preserve +empty lines within the code block verbatim. + +```````````````````````````````` example +- Foo + + bar + + + baz +. +
    +
  • +

    Foo

    +
    bar
    +
    +
    +baz
    +
    +
  • +
+```````````````````````````````` + +Note that ordered list start numbers must be nine digits or less: + +```````````````````````````````` example +123456789. ok +. +
    +
  1. ok
  2. +
+```````````````````````````````` + + +```````````````````````````````` example +1234567890. not ok +. +

1234567890. not ok

+```````````````````````````````` + + +A start number may begin with 0s: + +```````````````````````````````` example +0. ok +. +
    +
  1. ok
  2. +
+```````````````````````````````` + + +```````````````````````````````` example +003. ok +. +
    +
  1. ok
  2. +
+```````````````````````````````` + + +A start number may not be negative: + +```````````````````````````````` example +-1. not ok +. +

-1. not ok

+```````````````````````````````` + + + +2. **Item starting with indented code.** If a sequence of lines *Ls* + constitute a sequence of blocks *Bs* starting with an indented code + block, and *M* is a list marker of width *W* followed by + one space of indentation, then the result of prepending *M* and the + following space to the first line of *Ls*, and indenting subsequent lines + of *Ls* by *W + 1* spaces, is a list item with *Bs* as its contents. + If a line is empty, then it need not be indented. The type of the + list item (bullet or ordered) is determined by the type of its list + marker. If the list item is ordered, then it is also assigned a + start number, based on the ordered list marker. + +An indented code block will have to be preceded by four spaces of indentation +beyond the edge of the region where text will be included in the list item. +In the following case that is 6 spaces: + +```````````````````````````````` example +- foo + + bar +. +
    +
  • +

    foo

    +
    bar
    +
    +
  • +
+```````````````````````````````` + + +And in this case it is 11 spaces: + +```````````````````````````````` example + 10. foo + + bar +. +
    +
  1. +

    foo

    +
    bar
    +
    +
  2. +
+```````````````````````````````` + + +If the *first* block in the list item is an indented code block, +then by rule #2, the contents must be preceded by *one* space of indentation +after the list marker: + +```````````````````````````````` example + indented code + +paragraph + + more code +. +
indented code
+
+

paragraph

+
more code
+
+```````````````````````````````` + + +```````````````````````````````` example +1. indented code + + paragraph + + more code +. +
    +
  1. +
    indented code
    +
    +

    paragraph

    +
    more code
    +
    +
  2. +
+```````````````````````````````` + + +Note that an additional space of indentation is interpreted as space +inside the code block: + +```````````````````````````````` example +1. indented code + + paragraph + + more code +. +
    +
  1. +
     indented code
    +
    +

    paragraph

    +
    more code
    +
    +
  2. +
+```````````````````````````````` + + +Note that rules #1 and #2 only apply to two cases: (a) cases +in which the lines to be included in a list item begin with a +character other than a space or tab, and (b) cases in which +they begin with an indented code +block. In a case like the following, where the first block begins with +three spaces of indentation, the rules do not allow us to form a list item by +indenting the whole thing and prepending a list marker: + +```````````````````````````````` example + foo + +bar +. +

foo

+

bar

+```````````````````````````````` + + +```````````````````````````````` example +- foo + + bar +. +
    +
  • foo
  • +
+

bar

+```````````````````````````````` + + +This is not a significant restriction, because when a block is preceded by up to +three spaces of indentation, the indentation can always be removed without +a change in interpretation, allowing rule #1 to be applied. So, in +the above case: + +```````````````````````````````` example +- foo + + bar +. +
    +
  • +

    foo

    +

    bar

    +
  • +
+```````````````````````````````` + + +3. **Item starting with a blank line.** If a sequence of lines *Ls* + starting with a single [blank line] constitute a (possibly empty) + sequence of blocks *Bs*, and *M* is a list marker of width *W*, + then the result of prepending *M* to the first line of *Ls*, and + preceding subsequent lines of *Ls* by *W + 1* spaces of indentation, is a + list item with *Bs* as its contents. + If a line is empty, then it need not be indented. The type of the + list item (bullet or ordered) is determined by the type of its list + marker. If the list item is ordered, then it is also assigned a + start number, based on the ordered list marker. + +Here are some list items that start with a blank line but are not empty: + +```````````````````````````````` example +- + foo +- + ``` + bar + ``` +- + baz +. +
    +
  • foo
  • +
  • +
    bar
    +
    +
  • +
  • +
    baz
    +
    +
  • +
+```````````````````````````````` + +When the list item starts with a blank line, the number of spaces +following the list marker doesn't change the required indentation: + +```````````````````````````````` example +- + foo +. +
    +
  • foo
  • +
+```````````````````````````````` + + +A list item can begin with at most one blank line. +In the following example, `foo` is not part of the list +item: + +```````````````````````````````` example +- + + foo +. +
    +
  • +
+

foo

+```````````````````````````````` + + +Here is an empty bullet list item: + +```````````````````````````````` example +- foo +- +- bar +. +
    +
  • foo
  • +
  • +
  • bar
  • +
+```````````````````````````````` + + +It does not matter whether there are spaces or tabs following the [list marker]: + +```````````````````````````````` example +- foo +- +- bar +. +
    +
  • foo
  • +
  • +
  • bar
  • +
+```````````````````````````````` + + +Here is an empty ordered list item: + +```````````````````````````````` example +1. foo +2. +3. bar +. +
    +
  1. foo
  2. +
  3. +
  4. bar
  5. +
+```````````````````````````````` + + +A list may start or end with an empty list item: + +```````````````````````````````` example +* +. +
    +
  • +
+```````````````````````````````` + +However, an empty list item cannot interrupt a paragraph: + +```````````````````````````````` example +foo +* + +foo +1. +. +

foo +*

+

foo +1.

+```````````````````````````````` + + +4. **Indentation.** If a sequence of lines *Ls* constitutes a list item + according to rule #1, #2, or #3, then the result of preceding each line + of *Ls* by up to three spaces of indentation (the same for each line) also + constitutes a list item with the same contents and attributes. If a line is + empty, then it need not be indented. + +Indented one space: + +```````````````````````````````` example + 1. A paragraph + with two lines. + + indented code + + > A block quote. +. +
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+```````````````````````````````` + + +Indented two spaces: + +```````````````````````````````` example + 1. A paragraph + with two lines. + + indented code + + > A block quote. +. +
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+```````````````````````````````` + + +Indented three spaces: + +```````````````````````````````` example + 1. A paragraph + with two lines. + + indented code + + > A block quote. +. +
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+```````````````````````````````` + + +Four spaces indent gives a code block: + +```````````````````````````````` example + 1. A paragraph + with two lines. + + indented code + + > A block quote. +. +
1.  A paragraph
+    with two lines.
+
+        indented code
+
+    > A block quote.
+
+```````````````````````````````` + + + +5. **Laziness.** If a string of lines *Ls* constitute a [list + item](#list-items) with contents *Bs*, then the result of deleting + some or all of the indentation from one or more lines in which the + next character other than a space or tab after the indentation is + [paragraph continuation text] is a + list item with the same contents and attributes. The unindented + lines are called + [lazy continuation line](@)s. + +Here is an example with [lazy continuation lines]: + +```````````````````````````````` example + 1. A paragraph +with two lines. + + indented code + + > A block quote. +. +
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+```````````````````````````````` + + +Indentation can be partially deleted: + +```````````````````````````````` example + 1. A paragraph + with two lines. +. +
    +
  1. A paragraph +with two lines.
  2. +
+```````````````````````````````` + + +These examples show how laziness can work in nested structures: + +```````````````````````````````` example +> 1. > Blockquote +continued here. +. +
+
    +
  1. +
    +

    Blockquote +continued here.

    +
    +
  2. +
+
+```````````````````````````````` + + +```````````````````````````````` example +> 1. > Blockquote +> continued here. +. +
+
    +
  1. +
    +

    Blockquote +continued here.

    +
    +
  2. +
+
+```````````````````````````````` + + + +6. **That's all.** Nothing that is not counted as a list item by rules + #1--5 counts as a [list item](#list-items). + +The rules for sublists follow from the general rules +[above][List items]. A sublist must be indented the same number +of spaces of indentation a paragraph would need to be in order to be included +in the list item. + +So, in this case we need two spaces indent: + +```````````````````````````````` example +- foo + - bar + - baz + - boo +. +
    +
  • foo +
      +
    • bar +
        +
      • baz +
          +
        • boo
        • +
        +
      • +
      +
    • +
    +
  • +
+```````````````````````````````` + + +One is not enough: + +```````````````````````````````` example +- foo + - bar + - baz + - boo +. +
    +
  • foo
  • +
  • bar
  • +
  • baz
  • +
  • boo
  • +
+```````````````````````````````` + + +Here we need four, because the list marker is wider: + +```````````````````````````````` example +10) foo + - bar +. +
    +
  1. foo +
      +
    • bar
    • +
    +
  2. +
+```````````````````````````````` + + +Three is not enough: + +```````````````````````````````` example +10) foo + - bar +. +
    +
  1. foo
  2. +
+
    +
  • bar
  • +
+```````````````````````````````` + + +A list may be the first block in a list item: + +```````````````````````````````` example +- - foo +. +
    +
  • +
      +
    • foo
    • +
    +
  • +
+```````````````````````````````` + + +```````````````````````````````` example +1. - 2. foo +. +
    +
  1. +
      +
    • +
        +
      1. foo
      2. +
      +
    • +
    +
  2. +
+```````````````````````````````` + + +A list item can contain a heading: + +```````````````````````````````` example +- # Foo +- Bar + --- + baz +. +
    +
  • +

    Foo

    +
  • +
  • +

    Bar

    +baz
  • +
+```````````````````````````````` + + +### Motivation + +John Gruber's Markdown spec says the following about list items: + +1. "List markers typically start at the left margin, but may be indented + by up to three spaces. List markers must be followed by one or more + spaces or a tab." + +2. "To make lists look nice, you can wrap items with hanging indents.... + But if you don't want to, you don't have to." + +3. "List items may consist of multiple paragraphs. Each subsequent + paragraph in a list item must be indented by either 4 spaces or one + tab." + +4. "It looks nice if you indent every line of the subsequent paragraphs, + but here again, Markdown will allow you to be lazy." + +5. "To put a blockquote within a list item, the blockquote's `>` + delimiters need to be indented." + +6. "To put a code block within a list item, the code block needs to be + indented twice — 8 spaces or two tabs." + +These rules specify that a paragraph under a list item must be indented +four spaces (presumably, from the left margin, rather than the start of +the list marker, but this is not said), and that code under a list item +must be indented eight spaces instead of the usual four. They also say +that a block quote must be indented, but not by how much; however, the +example given has four spaces indentation. Although nothing is said +about other kinds of block-level content, it is certainly reasonable to +infer that *all* block elements under a list item, including other +lists, must be indented four spaces. This principle has been called the +*four-space rule*. + +The four-space rule is clear and principled, and if the reference +implementation `Markdown.pl` had followed it, it probably would have +become the standard. However, `Markdown.pl` allowed paragraphs and +sublists to start with only two spaces indentation, at least on the +outer level. Worse, its behavior was inconsistent: a sublist of an +outer-level list needed two spaces indentation, but a sublist of this +sublist needed three spaces. It is not surprising, then, that different +implementations of Markdown have developed very different rules for +determining what comes under a list item. (Pandoc and python-Markdown, +for example, stuck with Gruber's syntax description and the four-space +rule, while discount, redcarpet, marked, PHP Markdown, and others +followed `Markdown.pl`'s behavior more closely.) + +Unfortunately, given the divergences between implementations, there +is no way to give a spec for list items that will be guaranteed not +to break any existing documents. However, the spec given here should +correctly handle lists formatted with either the four-space rule or +the more forgiving `Markdown.pl` behavior, provided they are laid out +in a way that is natural for a human to read. + +The strategy here is to let the width and indentation of the list marker +determine the indentation necessary for blocks to fall under the list +item, rather than having a fixed and arbitrary number. The writer can +think of the body of the list item as a unit which gets indented to the +right enough to fit the list marker (and any indentation on the list +marker). (The laziness rule, #5, then allows continuation lines to be +unindented if needed.) + +This rule is superior, we claim, to any rule requiring a fixed level of +indentation from the margin. The four-space rule is clear but +unnatural. It is quite unintuitive that + +``` markdown +- foo + + bar + + - baz +``` + +should be parsed as two lists with an intervening paragraph, + +``` html +
    +
  • foo
  • +
+

bar

+
    +
  • baz
  • +
+``` + +as the four-space rule demands, rather than a single list, + +``` html +
    +
  • +

    foo

    +

    bar

    +
      +
    • baz
    • +
    +
  • +
+``` + +The choice of four spaces is arbitrary. It can be learned, but it is +not likely to be guessed, and it trips up beginners regularly. + +Would it help to adopt a two-space rule? The problem is that such +a rule, together with the rule allowing up to three spaces of indentation for +the initial list marker, allows text that is indented *less than* the +original list marker to be included in the list item. For example, +`Markdown.pl` parses + +``` markdown + - one + + two +``` + +as a single list item, with `two` a continuation paragraph: + +``` html +
    +
  • +

    one

    +

    two

    +
  • +
+``` + +and similarly + +``` markdown +> - one +> +> two +``` + +as + +``` html +
+
    +
  • +

    one

    +

    two

    +
  • +
+
+``` + +This is extremely unintuitive. + +Rather than requiring a fixed indent from the margin, we could require +a fixed indent (say, two spaces, or even one space) from the list marker (which +may itself be indented). This proposal would remove the last anomaly +discussed. Unlike the spec presented above, it would count the following +as a list item with a subparagraph, even though the paragraph `bar` +is not indented as far as the first paragraph `foo`: + +``` markdown + 10. foo + + bar +``` + +Arguably this text does read like a list item with `bar` as a subparagraph, +which may count in favor of the proposal. However, on this proposal indented +code would have to be indented six spaces after the list marker. And this +would break a lot of existing Markdown, which has the pattern: + +``` markdown +1. foo + + indented code +``` + +where the code is indented eight spaces. The spec above, by contrast, will +parse this text as expected, since the code block's indentation is measured +from the beginning of `foo`. + +The one case that needs special treatment is a list item that *starts* +with indented code. How much indentation is required in that case, since +we don't have a "first paragraph" to measure from? Rule #2 simply stipulates +that in such cases, we require one space indentation from the list marker +(and then the normal four spaces for the indented code). This will match the +four-space rule in cases where the list marker plus its initial indentation +takes four spaces (a common case), but diverge in other cases. + +## Lists + +A [list](@) is a sequence of one or more +list items [of the same type]. The list items +may be separated by any number of blank lines. + +Two list items are [of the same type](@) +if they begin with a [list marker] of the same type. +Two list markers are of the +same type if (a) they are bullet list markers using the same character +(`-`, `+`, or `*`) or (b) they are ordered list numbers with the same +delimiter (either `.` or `)`). + +A list is an [ordered list](@) +if its constituent list items begin with +[ordered list markers], and a +[bullet list](@) if its constituent list +items begin with [bullet list markers]. + +The [start number](@) +of an [ordered list] is determined by the list number of +its initial list item. The numbers of subsequent list items are +disregarded. + +A list is [loose](@) if any of its constituent +list items are separated by blank lines, or if any of its constituent +list items directly contain two block-level elements with a blank line +between them. Otherwise a list is [tight](@). +(The difference in HTML output is that paragraphs in a loose list are +wrapped in `

` tags, while paragraphs in a tight list are not.) + +Changing the bullet or ordered list delimiter starts a new list: + +```````````````````````````````` example +- foo +- bar ++ baz +. +

    +
  • foo
  • +
  • bar
  • +
+
    +
  • baz
  • +
+```````````````````````````````` + + +```````````````````````````````` example +1. foo +2. bar +3) baz +. +
    +
  1. foo
  2. +
  3. bar
  4. +
+
    +
  1. baz
  2. +
+```````````````````````````````` + + +In CommonMark, a list can interrupt a paragraph. That is, +no blank line is needed to separate a paragraph from a following +list: + +```````````````````````````````` example +Foo +- bar +- baz +. +

Foo

+
    +
  • bar
  • +
  • baz
  • +
+```````````````````````````````` + +`Markdown.pl` does not allow this, through fear of triggering a list +via a numeral in a hard-wrapped line: + +``` markdown +The number of windows in my house is +14. The number of doors is 6. +``` + +Oddly, though, `Markdown.pl` *does* allow a blockquote to +interrupt a paragraph, even though the same considerations might +apply. + +In CommonMark, we do allow lists to interrupt paragraphs, for +two reasons. First, it is natural and not uncommon for people +to start lists without blank lines: + +``` markdown +I need to buy +- new shoes +- a coat +- a plane ticket +``` + +Second, we are attracted to a + +> [principle of uniformity](@): +> if a chunk of text has a certain +> meaning, it will continue to have the same meaning when put into a +> container block (such as a list item or blockquote). + +(Indeed, the spec for [list items] and [block quotes] presupposes +this principle.) This principle implies that if + +``` markdown + * I need to buy + - new shoes + - a coat + - a plane ticket +``` + +is a list item containing a paragraph followed by a nested sublist, +as all Markdown implementations agree it is (though the paragraph +may be rendered without `

` tags, since the list is "tight"), +then + +``` markdown +I need to buy +- new shoes +- a coat +- a plane ticket +``` + +by itself should be a paragraph followed by a nested sublist. + +Since it is well established Markdown practice to allow lists to +interrupt paragraphs inside list items, the [principle of +uniformity] requires us to allow this outside list items as +well. ([reStructuredText](https://docutils.sourceforge.net/rst.html) +takes a different approach, requiring blank lines before lists +even inside other list items.) + +In order to solve the problem of unwanted lists in paragraphs with +hard-wrapped numerals, we allow only lists starting with `1` to +interrupt paragraphs. Thus, + +```````````````````````````````` example +The number of windows in my house is +14. The number of doors is 6. +. +

The number of windows in my house is +14. The number of doors is 6.

+```````````````````````````````` + +We may still get an unintended result in cases like + +```````````````````````````````` example +The number of windows in my house is +1. The number of doors is 6. +. +

The number of windows in my house is

+
    +
  1. The number of doors is 6.
  2. +
+```````````````````````````````` + +but this rule should prevent most spurious list captures. + +There can be any number of blank lines between items: + +```````````````````````````````` example +- foo + +- bar + + +- baz +. +
    +
  • +

    foo

    +
  • +
  • +

    bar

    +
  • +
  • +

    baz

    +
  • +
+```````````````````````````````` + +```````````````````````````````` example +- foo + - bar + - baz + + + bim +. +
    +
  • foo +
      +
    • bar +
        +
      • +

        baz

        +

        bim

        +
      • +
      +
    • +
    +
  • +
+```````````````````````````````` + + +To separate consecutive lists of the same type, or to separate a +list from an indented code block that would otherwise be parsed +as a subparagraph of the final list item, you can insert a blank HTML +comment: + +```````````````````````````````` example +- foo +- bar + + + +- baz +- bim +. +
    +
  • foo
  • +
  • bar
  • +
+ +
    +
  • baz
  • +
  • bim
  • +
+```````````````````````````````` + + +```````````````````````````````` example +- foo + + notcode + +- foo + + + + code +. +
    +
  • +

    foo

    +

    notcode

    +
  • +
  • +

    foo

    +
  • +
+ +
code
+
+```````````````````````````````` + + +List items need not be indented to the same level. The following +list items will be treated as items at the same list level, +since none is indented enough to belong to the previous list +item: + +```````````````````````````````` example +- a + - b + - c + - d + - e + - f +- g +. +
    +
  • a
  • +
  • b
  • +
  • c
  • +
  • d
  • +
  • e
  • +
  • f
  • +
  • g
  • +
+```````````````````````````````` + + +```````````````````````````````` example +1. a + + 2. b + + 3. c +. +
    +
  1. +

    a

    +
  2. +
  3. +

    b

    +
  4. +
  5. +

    c

    +
  6. +
+```````````````````````````````` + +Note, however, that list items may not be preceded by more than +three spaces of indentation. Here `- e` is treated as a paragraph continuation +line, because it is indented more than three spaces: + +```````````````````````````````` example +- a + - b + - c + - d + - e +. +
    +
  • a
  • +
  • b
  • +
  • c
  • +
  • d +- e
  • +
+```````````````````````````````` + +And here, `3. c` is treated as in indented code block, +because it is indented four spaces and preceded by a +blank line. + +```````````````````````````````` example +1. a + + 2. b + + 3. c +. +
    +
  1. +

    a

    +
  2. +
  3. +

    b

    +
  4. +
+
3. c
+
+```````````````````````````````` + + +This is a loose list, because there is a blank line between +two of the list items: + +```````````````````````````````` example +- a +- b + +- c +. +
    +
  • +

    a

    +
  • +
  • +

    b

    +
  • +
  • +

    c

    +
  • +
+```````````````````````````````` + + +So is this, with a empty second item: + +```````````````````````````````` example +* a +* + +* c +. +
    +
  • +

    a

    +
  • +
  • +
  • +

    c

    +
  • +
+```````````````````````````````` + + +These are loose lists, even though there are no blank lines between the items, +because one of the items directly contains two block-level elements +with a blank line between them: + +```````````````````````````````` example +- a +- b + + c +- d +. +
    +
  • +

    a

    +
  • +
  • +

    b

    +

    c

    +
  • +
  • +

    d

    +
  • +
+```````````````````````````````` + + +```````````````````````````````` example +- a +- b + + [ref]: /url +- d +. +
    +
  • +

    a

    +
  • +
  • +

    b

    +
  • +
  • +

    d

    +
  • +
+```````````````````````````````` + + +This is a tight list, because the blank lines are in a code block: + +```````````````````````````````` example +- a +- ``` + b + + + ``` +- c +. +
    +
  • a
  • +
  • +
    b
    +
    +
    +
    +
  • +
  • c
  • +
+```````````````````````````````` + + +This is a tight list, because the blank line is between two +paragraphs of a sublist. So the sublist is loose while +the outer list is tight: + +```````````````````````````````` example +- a + - b + + c +- d +. +
    +
  • a +
      +
    • +

      b

      +

      c

      +
    • +
    +
  • +
  • d
  • +
+```````````````````````````````` + + +This is a tight list, because the blank line is inside the +block quote: + +```````````````````````````````` example +* a + > b + > +* c +. +
    +
  • a +
    +

    b

    +
    +
  • +
  • c
  • +
+```````````````````````````````` + + +This list is tight, because the consecutive block elements +are not separated by blank lines: + +```````````````````````````````` example +- a + > b + ``` + c + ``` +- d +. +
    +
  • a +
    +

    b

    +
    +
    c
    +
    +
  • +
  • d
  • +
+```````````````````````````````` + + +A single-paragraph list is tight: + +```````````````````````````````` example +- a +. +
    +
  • a
  • +
+```````````````````````````````` + + +```````````````````````````````` example +- a + - b +. +
    +
  • a +
      +
    • b
    • +
    +
  • +
+```````````````````````````````` + + +This list is loose, because of the blank line between the +two block elements in the list item: + +```````````````````````````````` example +1. ``` + foo + ``` + + bar +. +
    +
  1. +
    foo
    +
    +

    bar

    +
  2. +
+```````````````````````````````` + + +Here the outer list is loose, the inner list tight: + +```````````````````````````````` example +* foo + * bar + + baz +. +
    +
  • +

    foo

    +
      +
    • bar
    • +
    +

    baz

    +
  • +
+```````````````````````````````` + + +```````````````````````````````` example +- a + - b + - c + +- d + - e + - f +. +
    +
  • +

    a

    +
      +
    • b
    • +
    • c
    • +
    +
  • +
  • +

    d

    +
      +
    • e
    • +
    • f
    • +
    +
  • +
+```````````````````````````````` + + +# Inlines + +Inlines are parsed sequentially from the beginning of the character +stream to the end (left to right, in left-to-right languages). +Thus, for example, in + +```````````````````````````````` example +`hi`lo` +. +

hilo`

+```````````````````````````````` + +`hi` is parsed as code, leaving the backtick at the end as a literal +backtick. + + + +## Code spans + +A [backtick string](@) +is a string of one or more backtick characters (`` ` ``) that is neither +preceded nor followed by a backtick. + +A [code span](@) begins with a backtick string and ends with +a backtick string of equal length. The contents of the code span are +the characters between these two backtick strings, normalized in the +following ways: + +- First, [line endings] are converted to [spaces]. +- If the resulting string both begins *and* ends with a [space] + character, but does not consist entirely of [space] + characters, a single [space] character is removed from the + front and back. This allows you to include code that begins + or ends with backtick characters, which must be separated by + whitespace from the opening or closing backtick strings. + +This is a simple code span: + +```````````````````````````````` example +`foo` +. +

foo

+```````````````````````````````` + + +Here two backticks are used, because the code contains a backtick. +This example also illustrates stripping of a single leading and +trailing space: + +```````````````````````````````` example +`` foo ` bar `` +. +

foo ` bar

+```````````````````````````````` + + +This example shows the motivation for stripping leading and trailing +spaces: + +```````````````````````````````` example +` `` ` +. +

``

+```````````````````````````````` + +Note that only *one* space is stripped: + +```````````````````````````````` example +` `` ` +. +

``

+```````````````````````````````` + +The stripping only happens if the space is on both +sides of the string: + +```````````````````````````````` example +` a` +. +

a

+```````````````````````````````` + +Only [spaces], and not [unicode whitespace] in general, are +stripped in this way: + +```````````````````````````````` example +` b ` +. +

 b 

+```````````````````````````````` + +No stripping occurs if the code span contains only spaces: + +```````````````````````````````` example +` ` +` ` +. +

  +

+```````````````````````````````` + + +[Line endings] are treated like spaces: + +```````````````````````````````` example +`` +foo +bar +baz +`` +. +

foo bar baz

+```````````````````````````````` + +```````````````````````````````` example +`` +foo +`` +. +

foo

+```````````````````````````````` + + +Interior spaces are not collapsed: + +```````````````````````````````` example +`foo bar +baz` +. +

foo bar baz

+```````````````````````````````` + +Note that browsers will typically collapse consecutive spaces +when rendering `` elements, so it is recommended that +the following CSS be used: + + code{white-space: pre-wrap;} + + +Note that backslash escapes do not work in code spans. All backslashes +are treated literally: + +```````````````````````````````` example +`foo\`bar` +. +

foo\bar`

+```````````````````````````````` + + +Backslash escapes are never needed, because one can always choose a +string of *n* backtick characters as delimiters, where the code does +not contain any strings of exactly *n* backtick characters. + +```````````````````````````````` example +``foo`bar`` +. +

foo`bar

+```````````````````````````````` + +```````````````````````````````` example +` foo `` bar ` +. +

foo `` bar

+```````````````````````````````` + + +Code span backticks have higher precedence than any other inline +constructs except HTML tags and autolinks. Thus, for example, this is +not parsed as emphasized text, since the second `*` is part of a code +span: + +```````````````````````````````` example +*foo`*` +. +

*foo*

+```````````````````````````````` + + +And this is not parsed as a link: + +```````````````````````````````` example +[not a `link](/foo`) +. +

[not a link](/foo)

+```````````````````````````````` + + +Code spans, HTML tags, and autolinks have the same precedence. +Thus, this is code: + +```````````````````````````````` example +`` +. +

<a href="">`

+```````````````````````````````` + + +But this is an HTML tag: + +```````````````````````````````` example +
` +. +

`

+```````````````````````````````` + + +And this is code: + +```````````````````````````````` example +`` +. +

<https://foo.bar.baz>`

+```````````````````````````````` + + +But this is an autolink: + +```````````````````````````````` example +` +. +

https://foo.bar.`baz`

+```````````````````````````````` + + +When a backtick string is not closed by a matching backtick string, +we just have literal backticks: + +```````````````````````````````` example +```foo`` +. +

```foo``

+```````````````````````````````` + + +```````````````````````````````` example +`foo +. +

`foo

+```````````````````````````````` + +The following case also illustrates the need for opening and +closing backtick strings to be equal in length: + +```````````````````````````````` example +`foo``bar`` +. +

`foobar

+```````````````````````````````` + + +## Emphasis and strong emphasis + +John Gruber's original [Markdown syntax +description](https://daringfireball.net/projects/markdown/syntax#em) says: + +> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of +> emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML +> `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` +> tag. + +This is enough for most users, but these rules leave much undecided, +especially when it comes to nested emphasis. The original +`Markdown.pl` test suite makes it clear that triple `***` and +`___` delimiters can be used for strong emphasis, and most +implementations have also allowed the following patterns: + +``` markdown +***strong emph*** +***strong** in emph* +***emph* in strong** +**in strong *emph*** +*in emph **strong*** +``` + +The following patterns are less widely supported, but the intent +is clear and they are useful (especially in contexts like bibliography +entries): + +``` markdown +*emph *with emph* in it* +**strong **with strong** in it** +``` + +Many implementations have also restricted intraword emphasis to +the `*` forms, to avoid unwanted emphasis in words containing +internal underscores. (It is best practice to put these in code +spans, but users often do not.) + +``` markdown +internal emphasis: foo*bar*baz +no emphasis: foo_bar_baz +``` + +The rules given below capture all of these patterns, while allowing +for efficient parsing strategies that do not backtrack. + +First, some definitions. A [delimiter run](@) is either +a sequence of one or more `*` characters that is not preceded or +followed by a non-backslash-escaped `*` character, or a sequence +of one or more `_` characters that is not preceded or followed by +a non-backslash-escaped `_` character. + +A [left-flanking delimiter run](@) is +a [delimiter run] that is (1) not followed by [Unicode whitespace], +and either (2a) not followed by a [Unicode punctuation character], or +(2b) followed by a [Unicode punctuation character] and +preceded by [Unicode whitespace] or a [Unicode punctuation character]. +For purposes of this definition, the beginning and the end of +the line count as Unicode whitespace. + +A [right-flanking delimiter run](@) is +a [delimiter run] that is (1) not preceded by [Unicode whitespace], +and either (2a) not preceded by a [Unicode punctuation character], or +(2b) preceded by a [Unicode punctuation character] and +followed by [Unicode whitespace] or a [Unicode punctuation character]. +For purposes of this definition, the beginning and the end of +the line count as Unicode whitespace. + +Here are some examples of delimiter runs. + + - left-flanking but not right-flanking: + + ``` + ***abc + _abc + **"abc" + _"abc" + ``` + + - right-flanking but not left-flanking: + + ``` + abc*** + abc_ + "abc"** + "abc"_ + ``` + + - Both left and right-flanking: + + ``` + abc***def + "abc"_"def" + ``` + + - Neither left nor right-flanking: + + ``` + abc *** def + a _ b + ``` + +(The idea of distinguishing left-flanking and right-flanking +delimiter runs based on the character before and the character +after comes from Roopesh Chander's +[vfmd](https://web.archive.org/web/20220608143320/http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags). +vfmd uses the terminology "emphasis indicator string" instead of "delimiter +run," and its rules for distinguishing left- and right-flanking runs +are a bit more complex than the ones given here.) + +The following rules define emphasis and strong emphasis: + +1. A single `*` character [can open emphasis](@) + iff (if and only if) it is part of a [left-flanking delimiter run]. + +2. A single `_` character [can open emphasis] iff + it is part of a [left-flanking delimiter run] + and either (a) not part of a [right-flanking delimiter run] + or (b) part of a [right-flanking delimiter run] + preceded by a [Unicode punctuation character]. + +3. A single `*` character [can close emphasis](@) + iff it is part of a [right-flanking delimiter run]. + +4. A single `_` character [can close emphasis] iff + it is part of a [right-flanking delimiter run] + and either (a) not part of a [left-flanking delimiter run] + or (b) part of a [left-flanking delimiter run] + followed by a [Unicode punctuation character]. + +5. A double `**` [can open strong emphasis](@) + iff it is part of a [left-flanking delimiter run]. + +6. A double `__` [can open strong emphasis] iff + it is part of a [left-flanking delimiter run] + and either (a) not part of a [right-flanking delimiter run] + or (b) part of a [right-flanking delimiter run] + preceded by a [Unicode punctuation character]. + +7. A double `**` [can close strong emphasis](@) + iff it is part of a [right-flanking delimiter run]. + +8. A double `__` [can close strong emphasis] iff + it is part of a [right-flanking delimiter run] + and either (a) not part of a [left-flanking delimiter run] + or (b) part of a [left-flanking delimiter run] + followed by a [Unicode punctuation character]. + +9. Emphasis begins with a delimiter that [can open emphasis] and ends + with a delimiter that [can close emphasis], and that uses the same + character (`_` or `*`) as the opening delimiter. The + opening and closing delimiters must belong to separate + [delimiter runs]. If one of the delimiters can both + open and close emphasis, then the sum of the lengths of the + delimiter runs containing the opening and closing delimiters + must not be a multiple of 3 unless both lengths are + multiples of 3. + +10. Strong emphasis begins with a delimiter that + [can open strong emphasis] and ends with a delimiter that + [can close strong emphasis], and that uses the same character + (`_` or `*`) as the opening delimiter. The + opening and closing delimiters must belong to separate + [delimiter runs]. If one of the delimiters can both open + and close strong emphasis, then the sum of the lengths of + the delimiter runs containing the opening and closing + delimiters must not be a multiple of 3 unless both lengths + are multiples of 3. + +11. A literal `*` character cannot occur at the beginning or end of + `*`-delimited emphasis or `**`-delimited strong emphasis, unless it + is backslash-escaped. + +12. A literal `_` character cannot occur at the beginning or end of + `_`-delimited emphasis or `__`-delimited strong emphasis, unless it + is backslash-escaped. + +Where rules 1--12 above are compatible with multiple parsings, +the following principles resolve ambiguity: + +13. The number of nestings should be minimized. Thus, for example, + an interpretation `...` is always preferred to + `...`. + +14. An interpretation `...` is always + preferred to `...`. + +15. When two potential emphasis or strong emphasis spans overlap, + so that the second begins before the first ends and ends after + the first ends, the first takes precedence. Thus, for example, + `*foo _bar* baz_` is parsed as `foo _bar baz_` rather + than `*foo bar* baz`. + +16. When there are two potential emphasis or strong emphasis spans + with the same closing delimiter, the shorter one (the one that + opens later) takes precedence. Thus, for example, + `**foo **bar baz**` is parsed as `**foo bar baz` + rather than `foo **bar baz`. + +17. Inline code spans, links, images, and HTML tags group more tightly + than emphasis. So, when there is a choice between an interpretation + that contains one of these elements and one that does not, the + former always wins. Thus, for example, `*[foo*](bar)` is + parsed as `*foo*` rather than as + `[foo](bar)`. + +These rules can be illustrated through a series of examples. + +Rule 1: + +```````````````````````````````` example +*foo bar* +. +

foo bar

+```````````````````````````````` + + +This is not emphasis, because the opening `*` is followed by +whitespace, and hence not part of a [left-flanking delimiter run]: + +```````````````````````````````` example +a * foo bar* +. +

a * foo bar*

+```````````````````````````````` + + +This is not emphasis, because the opening `*` is preceded +by an alphanumeric and followed by punctuation, and hence +not part of a [left-flanking delimiter run]: + +```````````````````````````````` example +a*"foo"* +. +

a*"foo"*

+```````````````````````````````` + + +Unicode nonbreaking spaces count as whitespace, too: + +```````````````````````````````` example +* a * +. +

* a *

+```````````````````````````````` + + +Unicode symbols count as punctuation, too: + +```````````````````````````````` example +*$*alpha. + +*£*bravo. + +*€*charlie. +. +

*$*alpha.

+

*£*bravo.

+

*€*charlie.

+```````````````````````````````` + + +Intraword emphasis with `*` is permitted: + +```````````````````````````````` example +foo*bar* +. +

foobar

+```````````````````````````````` + + +```````````````````````````````` example +5*6*78 +. +

5678

+```````````````````````````````` + + +Rule 2: + +```````````````````````````````` example +_foo bar_ +. +

foo bar

+```````````````````````````````` + + +This is not emphasis, because the opening `_` is followed by +whitespace: + +```````````````````````````````` example +_ foo bar_ +. +

_ foo bar_

+```````````````````````````````` + + +This is not emphasis, because the opening `_` is preceded +by an alphanumeric and followed by punctuation: + +```````````````````````````````` example +a_"foo"_ +. +

a_"foo"_

+```````````````````````````````` + + +Emphasis with `_` is not allowed inside words: + +```````````````````````````````` example +foo_bar_ +. +

foo_bar_

+```````````````````````````````` + + +```````````````````````````````` example +5_6_78 +. +

5_6_78

+```````````````````````````````` + + +```````````````````````````````` example +пристаням_стремятся_ +. +

пристаням_стремятся_

+```````````````````````````````` + + +Here `_` does not generate emphasis, because the first delimiter run +is right-flanking and the second left-flanking: + +```````````````````````````````` example +aa_"bb"_cc +. +

aa_"bb"_cc

+```````````````````````````````` + + +This is emphasis, even though the opening delimiter is +both left- and right-flanking, because it is preceded by +punctuation: + +```````````````````````````````` example +foo-_(bar)_ +. +

foo-(bar)

+```````````````````````````````` + + +Rule 3: + +This is not emphasis, because the closing delimiter does +not match the opening delimiter: + +```````````````````````````````` example +_foo* +. +

_foo*

+```````````````````````````````` + + +This is not emphasis, because the closing `*` is preceded by +whitespace: + +```````````````````````````````` example +*foo bar * +. +

*foo bar *

+```````````````````````````````` + + +A line ending also counts as whitespace: + +```````````````````````````````` example +*foo bar +* +. +

*foo bar +*

+```````````````````````````````` + + +This is not emphasis, because the second `*` is +preceded by punctuation and followed by an alphanumeric +(hence it is not part of a [right-flanking delimiter run]: + +```````````````````````````````` example +*(*foo) +. +

*(*foo)

+```````````````````````````````` + + +The point of this restriction is more easily appreciated +with this example: + +```````````````````````````````` example +*(*foo*)* +. +

(foo)

+```````````````````````````````` + + +Intraword emphasis with `*` is allowed: + +```````````````````````````````` example +*foo*bar +. +

foobar

+```````````````````````````````` + + + +Rule 4: + +This is not emphasis, because the closing `_` is preceded by +whitespace: + +```````````````````````````````` example +_foo bar _ +. +

_foo bar _

+```````````````````````````````` + + +This is not emphasis, because the second `_` is +preceded by punctuation and followed by an alphanumeric: + +```````````````````````````````` example +_(_foo) +. +

_(_foo)

+```````````````````````````````` + + +This is emphasis within emphasis: + +```````````````````````````````` example +_(_foo_)_ +. +

(foo)

+```````````````````````````````` + + +Intraword emphasis is disallowed for `_`: + +```````````````````````````````` example +_foo_bar +. +

_foo_bar

+```````````````````````````````` + + +```````````````````````````````` example +_пристаням_стремятся +. +

_пристаням_стремятся

+```````````````````````````````` + + +```````````````````````````````` example +_foo_bar_baz_ +. +

foo_bar_baz

+```````````````````````````````` + + +This is emphasis, even though the closing delimiter is +both left- and right-flanking, because it is followed by +punctuation: + +```````````````````````````````` example +_(bar)_. +. +

(bar).

+```````````````````````````````` + + +Rule 5: + +```````````````````````````````` example +**foo bar** +. +

foo bar

+```````````````````````````````` + + +This is not strong emphasis, because the opening delimiter is +followed by whitespace: + +```````````````````````````````` example +** foo bar** +. +

** foo bar**

+```````````````````````````````` + + +This is not strong emphasis, because the opening `**` is preceded +by an alphanumeric and followed by punctuation, and hence +not part of a [left-flanking delimiter run]: + +```````````````````````````````` example +a**"foo"** +. +

a**"foo"**

+```````````````````````````````` + + +Intraword strong emphasis with `**` is permitted: + +```````````````````````````````` example +foo**bar** +. +

foobar

+```````````````````````````````` + + +Rule 6: + +```````````````````````````````` example +__foo bar__ +. +

foo bar

+```````````````````````````````` + + +This is not strong emphasis, because the opening delimiter is +followed by whitespace: + +```````````````````````````````` example +__ foo bar__ +. +

__ foo bar__

+```````````````````````````````` + + +A line ending counts as whitespace: +```````````````````````````````` example +__ +foo bar__ +. +

__ +foo bar__

+```````````````````````````````` + + +This is not strong emphasis, because the opening `__` is preceded +by an alphanumeric and followed by punctuation: + +```````````````````````````````` example +a__"foo"__ +. +

a__"foo"__

+```````````````````````````````` + + +Intraword strong emphasis is forbidden with `__`: + +```````````````````````````````` example +foo__bar__ +. +

foo__bar__

+```````````````````````````````` + + +```````````````````````````````` example +5__6__78 +. +

5__6__78

+```````````````````````````````` + + +```````````````````````````````` example +пристаням__стремятся__ +. +

пристаням__стремятся__

+```````````````````````````````` + + +```````````````````````````````` example +__foo, __bar__, baz__ +. +

foo, bar, baz

+```````````````````````````````` + + +This is strong emphasis, even though the opening delimiter is +both left- and right-flanking, because it is preceded by +punctuation: + +```````````````````````````````` example +foo-__(bar)__ +. +

foo-(bar)

+```````````````````````````````` + + + +Rule 7: + +This is not strong emphasis, because the closing delimiter is preceded +by whitespace: + +```````````````````````````````` example +**foo bar ** +. +

**foo bar **

+```````````````````````````````` + + +(Nor can it be interpreted as an emphasized `*foo bar *`, because of +Rule 11.) + +This is not strong emphasis, because the second `**` is +preceded by punctuation and followed by an alphanumeric: + +```````````````````````````````` example +**(**foo) +. +

**(**foo)

+```````````````````````````````` + + +The point of this restriction is more easily appreciated +with these examples: + +```````````````````````````````` example +*(**foo**)* +. +

(foo)

+```````````````````````````````` + + +```````````````````````````````` example +**Gomphocarpus (*Gomphocarpus physocarpus*, syn. +*Asclepias physocarpa*)** +. +

Gomphocarpus (Gomphocarpus physocarpus, syn. +Asclepias physocarpa)

+```````````````````````````````` + + +```````````````````````````````` example +**foo "*bar*" foo** +. +

foo "bar" foo

+```````````````````````````````` + + +Intraword emphasis: + +```````````````````````````````` example +**foo**bar +. +

foobar

+```````````````````````````````` + + +Rule 8: + +This is not strong emphasis, because the closing delimiter is +preceded by whitespace: + +```````````````````````````````` example +__foo bar __ +. +

__foo bar __

+```````````````````````````````` + + +This is not strong emphasis, because the second `__` is +preceded by punctuation and followed by an alphanumeric: + +```````````````````````````````` example +__(__foo) +. +

__(__foo)

+```````````````````````````````` + + +The point of this restriction is more easily appreciated +with this example: + +```````````````````````````````` example +_(__foo__)_ +. +

(foo)

+```````````````````````````````` + + +Intraword strong emphasis is forbidden with `__`: + +```````````````````````````````` example +__foo__bar +. +

__foo__bar

+```````````````````````````````` + + +```````````````````````````````` example +__пристаням__стремятся +. +

__пристаням__стремятся

+```````````````````````````````` + + +```````````````````````````````` example +__foo__bar__baz__ +. +

foo__bar__baz

+```````````````````````````````` + + +This is strong emphasis, even though the closing delimiter is +both left- and right-flanking, because it is followed by +punctuation: + +```````````````````````````````` example +__(bar)__. +. +

(bar).

+```````````````````````````````` + + +Rule 9: + +Any nonempty sequence of inline elements can be the contents of an +emphasized span. + +```````````````````````````````` example +*foo [bar](/url)* +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +*foo +bar* +. +

foo +bar

+```````````````````````````````` + + +In particular, emphasis and strong emphasis can be nested +inside emphasis: + +```````````````````````````````` example +_foo __bar__ baz_ +. +

foo bar baz

+```````````````````````````````` + + +```````````````````````````````` example +_foo _bar_ baz_ +. +

foo bar baz

+```````````````````````````````` + + +```````````````````````````````` example +__foo_ bar_ +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +*foo *bar** +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +*foo **bar** baz* +. +

foo bar baz

+```````````````````````````````` + +```````````````````````````````` example +*foo**bar**baz* +. +

foobarbaz

+```````````````````````````````` + +Note that in the preceding case, the interpretation + +``` markdown +

foobarbaz

+``` + + +is precluded by the condition that a delimiter that +can both open and close (like the `*` after `foo`) +cannot form emphasis if the sum of the lengths of +the delimiter runs containing the opening and +closing delimiters is a multiple of 3 unless +both lengths are multiples of 3. + + +For the same reason, we don't get two consecutive +emphasis sections in this example: + +```````````````````````````````` example +*foo**bar* +. +

foo**bar

+```````````````````````````````` + + +The same condition ensures that the following +cases are all strong emphasis nested inside +emphasis, even when the interior whitespace is +omitted: + + +```````````````````````````````` example +***foo** bar* +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +*foo **bar*** +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +*foo**bar*** +. +

foobar

+```````````````````````````````` + + +When the lengths of the interior closing and opening +delimiter runs are *both* multiples of 3, though, +they can match to create emphasis: + +```````````````````````````````` example +foo***bar***baz +. +

foobarbaz

+```````````````````````````````` + +```````````````````````````````` example +foo******bar*********baz +. +

foobar***baz

+```````````````````````````````` + + +Indefinite levels of nesting are possible: + +```````````````````````````````` example +*foo **bar *baz* bim** bop* +. +

foo bar baz bim bop

+```````````````````````````````` + + +```````````````````````````````` example +*foo [*bar*](/url)* +. +

foo bar

+```````````````````````````````` + + +There can be no empty emphasis or strong emphasis: + +```````````````````````````````` example +** is not an empty emphasis +. +

** is not an empty emphasis

+```````````````````````````````` + + +```````````````````````````````` example +**** is not an empty strong emphasis +. +

**** is not an empty strong emphasis

+```````````````````````````````` + + + +Rule 10: + +Any nonempty sequence of inline elements can be the contents of an +strongly emphasized span. + +```````````````````````````````` example +**foo [bar](/url)** +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +**foo +bar** +. +

foo +bar

+```````````````````````````````` + + +In particular, emphasis and strong emphasis can be nested +inside strong emphasis: + +```````````````````````````````` example +__foo _bar_ baz__ +. +

foo bar baz

+```````````````````````````````` + + +```````````````````````````````` example +__foo __bar__ baz__ +. +

foo bar baz

+```````````````````````````````` + + +```````````````````````````````` example +____foo__ bar__ +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +**foo **bar**** +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +**foo *bar* baz** +. +

foo bar baz

+```````````````````````````````` + + +```````````````````````````````` example +**foo*bar*baz** +. +

foobarbaz

+```````````````````````````````` + + +```````````````````````````````` example +***foo* bar** +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +**foo *bar*** +. +

foo bar

+```````````````````````````````` + + +Indefinite levels of nesting are possible: + +```````````````````````````````` example +**foo *bar **baz** +bim* bop** +. +

foo bar baz +bim bop

+```````````````````````````````` + + +```````````````````````````````` example +**foo [*bar*](/url)** +. +

foo bar

+```````````````````````````````` + + +There can be no empty emphasis or strong emphasis: + +```````````````````````````````` example +__ is not an empty emphasis +. +

__ is not an empty emphasis

+```````````````````````````````` + + +```````````````````````````````` example +____ is not an empty strong emphasis +. +

____ is not an empty strong emphasis

+```````````````````````````````` + + + +Rule 11: + +```````````````````````````````` example +foo *** +. +

foo ***

+```````````````````````````````` + + +```````````````````````````````` example +foo *\** +. +

foo *

+```````````````````````````````` + + +```````````````````````````````` example +foo *_* +. +

foo _

+```````````````````````````````` + + +```````````````````````````````` example +foo ***** +. +

foo *****

+```````````````````````````````` + + +```````````````````````````````` example +foo **\*** +. +

foo *

+```````````````````````````````` + + +```````````````````````````````` example +foo **_** +. +

foo _

+```````````````````````````````` + + +Note that when delimiters do not match evenly, Rule 11 determines +that the excess literal `*` characters will appear outside of the +emphasis, rather than inside it: + +```````````````````````````````` example +**foo* +. +

*foo

+```````````````````````````````` + + +```````````````````````````````` example +*foo** +. +

foo*

+```````````````````````````````` + + +```````````````````````````````` example +***foo** +. +

*foo

+```````````````````````````````` + + +```````````````````````````````` example +****foo* +. +

***foo

+```````````````````````````````` + + +```````````````````````````````` example +**foo*** +. +

foo*

+```````````````````````````````` + + +```````````````````````````````` example +*foo**** +. +

foo***

+```````````````````````````````` + + + +Rule 12: + +```````````````````````````````` example +foo ___ +. +

foo ___

+```````````````````````````````` + + +```````````````````````````````` example +foo _\__ +. +

foo _

+```````````````````````````````` + + +```````````````````````````````` example +foo _*_ +. +

foo *

+```````````````````````````````` + + +```````````````````````````````` example +foo _____ +. +

foo _____

+```````````````````````````````` + + +```````````````````````````````` example +foo __\___ +. +

foo _

+```````````````````````````````` + + +```````````````````````````````` example +foo __*__ +. +

foo *

+```````````````````````````````` + + +```````````````````````````````` example +__foo_ +. +

_foo

+```````````````````````````````` + + +Note that when delimiters do not match evenly, Rule 12 determines +that the excess literal `_` characters will appear outside of the +emphasis, rather than inside it: + +```````````````````````````````` example +_foo__ +. +

foo_

+```````````````````````````````` + + +```````````````````````````````` example +___foo__ +. +

_foo

+```````````````````````````````` + + +```````````````````````````````` example +____foo_ +. +

___foo

+```````````````````````````````` + + +```````````````````````````````` example +__foo___ +. +

foo_

+```````````````````````````````` + + +```````````````````````````````` example +_foo____ +. +

foo___

+```````````````````````````````` + + +Rule 13 implies that if you want emphasis nested directly inside +emphasis, you must use different delimiters: + +```````````````````````````````` example +**foo** +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +*_foo_* +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +__foo__ +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +_*foo*_ +. +

foo

+```````````````````````````````` + + +However, strong emphasis within strong emphasis is possible without +switching delimiters: + +```````````````````````````````` example +****foo**** +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +____foo____ +. +

foo

+```````````````````````````````` + + + +Rule 13 can be applied to arbitrarily long sequences of +delimiters: + +```````````````````````````````` example +******foo****** +. +

foo

+```````````````````````````````` + + +Rule 14: + +```````````````````````````````` example +***foo*** +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +_____foo_____ +. +

foo

+```````````````````````````````` + + +Rule 15: + +```````````````````````````````` example +*foo _bar* baz_ +. +

foo _bar baz_

+```````````````````````````````` + + +```````````````````````````````` example +*foo __bar *baz bim__ bam* +. +

foo bar *baz bim bam

+```````````````````````````````` + + +Rule 16: + +```````````````````````````````` example +**foo **bar baz** +. +

**foo bar baz

+```````````````````````````````` + + +```````````````````````````````` example +*foo *bar baz* +. +

*foo bar baz

+```````````````````````````````` + + +Rule 17: + +```````````````````````````````` example +*[bar*](/url) +. +

*bar*

+```````````````````````````````` + + +```````````````````````````````` example +_foo [bar_](/url) +. +

_foo bar_

+```````````````````````````````` + + +```````````````````````````````` example +* +. +

*

+```````````````````````````````` + + +```````````````````````````````` example +** +. +

**

+```````````````````````````````` + + +```````````````````````````````` example +__ +. +

__

+```````````````````````````````` + + +```````````````````````````````` example +*a `*`* +. +

a *

+```````````````````````````````` + + +```````````````````````````````` example +_a `_`_ +. +

a _

+```````````````````````````````` + + +```````````````````````````````` example +**a +. +

**ahttps://foo.bar/?q=**

+```````````````````````````````` + + +```````````````````````````````` example +__a +. +

__ahttps://foo.bar/?q=__

+```````````````````````````````` + + + +## Links + +A link contains [link text] (the visible text), a [link destination] +(the URI that is the link destination), and optionally a [link title]. +There are two basic kinds of links in Markdown. In [inline links] the +destination and title are given immediately after the link text. In +[reference links] the destination and title are defined elsewhere in +the document. + +A [link text](@) consists of a sequence of zero or more +inline elements enclosed by square brackets (`[` and `]`). The +following rules apply: + +- Links may not contain other links, at any level of nesting. If + multiple otherwise valid link definitions appear nested inside each + other, the inner-most definition is used. + +- Brackets are allowed in the [link text] only if (a) they + are backslash-escaped or (b) they appear as a matched pair of brackets, + with an open bracket `[`, a sequence of zero or more inlines, and + a close bracket `]`. + +- Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly + than the brackets in link text. Thus, for example, + `` [foo`]` `` could not be a link text, since the second `]` + is part of a code span. + +- The brackets in link text bind more tightly than markers for + [emphasis and strong emphasis]. Thus, for example, `*[foo*](url)` is a link. + +A [link destination](@) consists of either + +- a sequence of zero or more characters between an opening `<` and a + closing `>` that contains no line endings or unescaped + `<` or `>` characters, or + +- a nonempty sequence of characters that does not start with `<`, + does not include [ASCII control characters][ASCII control character] + or [space] character, and includes parentheses only if (a) they are + backslash-escaped or (b) they are part of a balanced pair of + unescaped parentheses. + (Implementations may impose limits on parentheses nesting to + avoid performance issues, but at least three levels of nesting + should be supported.) + +A [link title](@) consists of either + +- a sequence of zero or more characters between straight double-quote + characters (`"`), including a `"` character only if it is + backslash-escaped, or + +- a sequence of zero or more characters between straight single-quote + characters (`'`), including a `'` character only if it is + backslash-escaped, or + +- a sequence of zero or more characters between matching parentheses + (`(...)`), including a `(` or `)` character only if it is + backslash-escaped. + +Although [link titles] may span multiple lines, they may not contain +a [blank line]. + +An [inline link](@) consists of a [link text] followed immediately +by a left parenthesis `(`, an optional [link destination], an optional +[link title], and a right parenthesis `)`. +These four components may be separated by spaces, tabs, and up to one line +ending. +If both [link destination] and [link title] are present, they *must* be +separated by spaces, tabs, and up to one line ending. + +The link's text consists of the inlines contained +in the [link text] (excluding the enclosing square brackets). +The link's URI consists of the link destination, excluding enclosing +`<...>` if present, with backslash-escapes in effect as described +above. The link's title consists of the link title, excluding its +enclosing delimiters, with backslash-escapes in effect as described +above. + +Here is a simple inline link: + +```````````````````````````````` example +[link](/uri "title") +. +

link

+```````````````````````````````` + + +The title, the link text and even +the destination may be omitted: + +```````````````````````````````` example +[link](/uri) +. +

link

+```````````````````````````````` + +```````````````````````````````` example +[](./target.md) +. +

+```````````````````````````````` + + +```````````````````````````````` example +[link]() +. +

link

+```````````````````````````````` + + +```````````````````````````````` example +[link](<>) +. +

link

+```````````````````````````````` + + +```````````````````````````````` example +[]() +. +

+```````````````````````````````` + +The destination can only contain spaces if it is +enclosed in pointy brackets: + +```````````````````````````````` example +[link](/my uri) +. +

[link](/my uri)

+```````````````````````````````` + +```````````````````````````````` example +[link](
) +. +

link

+```````````````````````````````` + +The destination cannot contain line endings, +even if enclosed in pointy brackets: + +```````````````````````````````` example +[link](foo +bar) +. +

[link](foo +bar)

+```````````````````````````````` + +```````````````````````````````` example +[link]() +. +

[link]()

+```````````````````````````````` + +The destination can contain `)` if it is enclosed +in pointy brackets: + +```````````````````````````````` example +[a]() +. +

a

+```````````````````````````````` + +Pointy brackets that enclose links must be unescaped: + +```````````````````````````````` example +[link]() +. +

[link](<foo>)

+```````````````````````````````` + +These are not links, because the opening pointy bracket +is not matched properly: + +```````````````````````````````` example +[a]( +[a](c) +. +

[a](<b)c +[a](<b)c> +[a](c)

+```````````````````````````````` + +Parentheses inside the link destination may be escaped: + +```````````````````````````````` example +[link](\(foo\)) +. +

link

+```````````````````````````````` + +Any number of parentheses are allowed without escaping, as long as they are +balanced: + +```````````````````````````````` example +[link](foo(and(bar))) +. +

link

+```````````````````````````````` + +However, if you have unbalanced parentheses, you need to escape or use the +`<...>` form: + +```````````````````````````````` example +[link](foo(and(bar)) +. +

[link](foo(and(bar))

+```````````````````````````````` + + +```````````````````````````````` example +[link](foo\(and\(bar\)) +. +

link

+```````````````````````````````` + + +```````````````````````````````` example +[link]() +. +

link

+```````````````````````````````` + + +Parentheses and other symbols can also be escaped, as usual +in Markdown: + +```````````````````````````````` example +[link](foo\)\:) +. +

link

+```````````````````````````````` + + +A link can contain fragment identifiers and queries: + +```````````````````````````````` example +[link](#fragment) + +[link](https://example.com#fragment) + +[link](https://example.com?foo=3#frag) +. +

link

+

link

+

link

+```````````````````````````````` + + +Note that a backslash before a non-escapable character is +just a backslash: + +```````````````````````````````` example +[link](foo\bar) +. +

link

+```````````````````````````````` + + +URL-escaping should be left alone inside the destination, as all +URL-escaped characters are also valid URL characters. Entity and +numerical character references in the destination will be parsed +into the corresponding Unicode code points, as usual. These may +be optionally URL-escaped when written as HTML, but this spec +does not enforce any particular policy for rendering URLs in +HTML or other formats. Renderers may make different decisions +about how to escape or normalize URLs in the output. + +```````````````````````````````` example +[link](foo%20bä) +. +

link

+```````````````````````````````` + + +Note that, because titles can often be parsed as destinations, +if you try to omit the destination and keep the title, you'll +get unexpected results: + +```````````````````````````````` example +[link]("title") +. +

link

+```````````````````````````````` + + +Titles may be in single quotes, double quotes, or parentheses: + +```````````````````````````````` example +[link](/url "title") +[link](/url 'title') +[link](/url (title)) +. +

link +link +link

+```````````````````````````````` + + +Backslash escapes and entity and numeric character references +may be used in titles: + +```````````````````````````````` example +[link](/url "title \""") +. +

link

+```````````````````````````````` + + +Titles must be separated from the link using spaces, tabs, and up to one line +ending. +Other [Unicode whitespace] like non-breaking space doesn't work. + +```````````````````````````````` example +[link](/url "title") +. +

link

+```````````````````````````````` + + +Nested balanced quotes are not allowed without escaping: + +```````````````````````````````` example +[link](/url "title "and" title") +. +

[link](/url "title "and" title")

+```````````````````````````````` + + +But it is easy to work around this by using a different quote type: + +```````````````````````````````` example +[link](/url 'title "and" title') +. +

link

+```````````````````````````````` + + +(Note: `Markdown.pl` did allow double quotes inside a double-quoted +title, and its test suite included a test demonstrating this. +But it is hard to see a good rationale for the extra complexity this +brings, since there are already many ways---backslash escaping, +entity and numeric character references, or using a different +quote type for the enclosing title---to write titles containing +double quotes. `Markdown.pl`'s handling of titles has a number +of other strange features. For example, it allows single-quoted +titles in inline links, but not reference links. And, in +reference links but not inline links, it allows a title to begin +with `"` and end with `)`. `Markdown.pl` 1.0.1 even allows +titles with no closing quotation mark, though 1.0.2b8 does not. +It seems preferable to adopt a simple, rational rule that works +the same way in inline links and link reference definitions.) + +Spaces, tabs, and up to one line ending is allowed around the destination and +title: + +```````````````````````````````` example +[link]( /uri + "title" ) +. +

link

+```````````````````````````````` + + +But it is not allowed between the link text and the +following parenthesis: + +```````````````````````````````` example +[link] (/uri) +. +

[link] (/uri)

+```````````````````````````````` + + +The link text may contain balanced brackets, but not unbalanced ones, +unless they are escaped: + +```````````````````````````````` example +[link [foo [bar]]](/uri) +. +

link [foo [bar]]

+```````````````````````````````` + + +```````````````````````````````` example +[link] bar](/uri) +. +

[link] bar](/uri)

+```````````````````````````````` + + +```````````````````````````````` example +[link [bar](/uri) +. +

[link bar

+```````````````````````````````` + + +```````````````````````````````` example +[link \[bar](/uri) +. +

link [bar

+```````````````````````````````` + + +The link text may contain inline content: + +```````````````````````````````` example +[link *foo **bar** `#`*](/uri) +. +

link foo bar #

+```````````````````````````````` + + +```````````````````````````````` example +[![moon](moon.jpg)](/uri) +. +

moon

+```````````````````````````````` + + +However, links may not contain other links, at any level of nesting. + +```````````````````````````````` example +[foo [bar](/uri)](/uri) +. +

[foo bar](/uri)

+```````````````````````````````` + + +```````````````````````````````` example +[foo *[bar [baz](/uri)](/uri)*](/uri) +. +

[foo [bar baz](/uri)](/uri)

+```````````````````````````````` + + +```````````````````````````````` example +![[[foo](uri1)](uri2)](uri3) +. +

[foo](uri2)

+```````````````````````````````` + + +These cases illustrate the precedence of link text grouping over +emphasis grouping: + +```````````````````````````````` example +*[foo*](/uri) +. +

*foo*

+```````````````````````````````` + + +```````````````````````````````` example +[foo *bar](baz*) +. +

foo *bar

+```````````````````````````````` + + +Note that brackets that *aren't* part of links do not take +precedence: + +```````````````````````````````` example +*foo [bar* baz] +. +

foo [bar baz]

+```````````````````````````````` + + +These cases illustrate the precedence of HTML tags, code spans, +and autolinks over link grouping: + +```````````````````````````````` example +[foo +. +

[foo

+```````````````````````````````` + + +```````````````````````````````` example +[foo`](/uri)` +. +

[foo](/uri)

+```````````````````````````````` + + +```````````````````````````````` example +[foo +. +

[foohttps://example.com/?search=](uri)

+```````````````````````````````` + + +There are three kinds of [reference link](@)s: +[full](#full-reference-link), [collapsed](#collapsed-reference-link), +and [shortcut](#shortcut-reference-link). + +A [full reference link](@) +consists of a [link text] immediately followed by a [link label] +that [matches] a [link reference definition] elsewhere in the document. + +A [link label](@) begins with a left bracket (`[`) and ends +with the first right bracket (`]`) that is not backslash-escaped. +Between these brackets there must be at least one character that is not a space, +tab, or line ending. +Unescaped square bracket characters are not allowed inside the +opening and closing square brackets of [link labels]. A link +label can have at most 999 characters inside the square +brackets. + +One label [matches](@) +another just in case their normalized forms are equal. To normalize a +label, strip off the opening and closing brackets, +perform the *Unicode case fold*, strip leading and trailing +spaces, tabs, and line endings, and collapse consecutive internal +spaces, tabs, and line endings to a single space. If there are multiple +matching reference link definitions, the one that comes first in the +document is used. (It is desirable in such cases to emit a warning.) + +The link's URI and title are provided by the matching [link +reference definition]. + +Here is a simple example: + +```````````````````````````````` example +[foo][bar] + +[bar]: /url "title" +. +

foo

+```````````````````````````````` + + +The rules for the [link text] are the same as with +[inline links]. Thus: + +The link text may contain balanced brackets, but not unbalanced ones, +unless they are escaped: + +```````````````````````````````` example +[link [foo [bar]]][ref] + +[ref]: /uri +. +

link [foo [bar]]

+```````````````````````````````` + + +```````````````````````````````` example +[link \[bar][ref] + +[ref]: /uri +. +

link [bar

+```````````````````````````````` + + +The link text may contain inline content: + +```````````````````````````````` example +[link *foo **bar** `#`*][ref] + +[ref]: /uri +. +

link foo bar #

+```````````````````````````````` + + +```````````````````````````````` example +[![moon](moon.jpg)][ref] + +[ref]: /uri +. +

moon

+```````````````````````````````` + + +However, links may not contain other links, at any level of nesting. + +```````````````````````````````` example +[foo [bar](/uri)][ref] + +[ref]: /uri +. +

[foo bar]ref

+```````````````````````````````` + + +```````````````````````````````` example +[foo *bar [baz][ref]*][ref] + +[ref]: /uri +. +

[foo bar baz]ref

+```````````````````````````````` + + +(In the examples above, we have two [shortcut reference links] +instead of one [full reference link].) + +The following cases illustrate the precedence of link text grouping over +emphasis grouping: + +```````````````````````````````` example +*[foo*][ref] + +[ref]: /uri +. +

*foo*

+```````````````````````````````` + + +```````````````````````````````` example +[foo *bar][ref]* + +[ref]: /uri +. +

foo *bar*

+```````````````````````````````` + + +These cases illustrate the precedence of HTML tags, code spans, +and autolinks over link grouping: + +```````````````````````````````` example +[foo + +[ref]: /uri +. +

[foo

+```````````````````````````````` + + +```````````````````````````````` example +[foo`][ref]` + +[ref]: /uri +. +

[foo][ref]

+```````````````````````````````` + + +```````````````````````````````` example +[foo + +[ref]: /uri +. +

[foohttps://example.com/?search=][ref]

+```````````````````````````````` + + +Matching is case-insensitive: + +```````````````````````````````` example +[foo][BaR] + +[bar]: /url "title" +. +

foo

+```````````````````````````````` + + +Unicode case fold is used: + +```````````````````````````````` example +[ẞ] + +[SS]: /url +. +

ẞ

+```````````````````````````````` + + +Consecutive internal spaces, tabs, and line endings are treated as one space for +purposes of determining matching: + +```````````````````````````````` example +[Foo + bar]: /url + +[Baz][Foo bar] +. +

Baz

+```````````````````````````````` + + +No spaces, tabs, or line endings are allowed between the [link text] and the +[link label]: + +```````````````````````````````` example +[foo] [bar] + +[bar]: /url "title" +. +

[foo] bar

+```````````````````````````````` + + +```````````````````````````````` example +[foo] +[bar] + +[bar]: /url "title" +. +

[foo] +bar

+```````````````````````````````` + + +This is a departure from John Gruber's original Markdown syntax +description, which explicitly allows whitespace between the link +text and the link label. It brings reference links in line with +[inline links], which (according to both original Markdown and +this spec) cannot have whitespace after the link text. More +importantly, it prevents inadvertent capture of consecutive +[shortcut reference links]. If whitespace is allowed between the +link text and the link label, then in the following we will have +a single reference link, not two shortcut reference links, as +intended: + +``` markdown +[foo] +[bar] + +[foo]: /url1 +[bar]: /url2 +``` + +(Note that [shortcut reference links] were introduced by Gruber +himself in a beta version of `Markdown.pl`, but never included +in the official syntax description. Without shortcut reference +links, it is harmless to allow space between the link text and +link label; but once shortcut references are introduced, it is +too dangerous to allow this, as it frequently leads to +unintended results.) + +When there are multiple matching [link reference definitions], +the first is used: + +```````````````````````````````` example +[foo]: /url1 + +[foo]: /url2 + +[bar][foo] +. +

bar

+```````````````````````````````` + + +Note that matching is performed on normalized strings, not parsed +inline content. So the following does not match, even though the +labels define equivalent inline content: + +```````````````````````````````` example +[bar][foo\!] + +[foo!]: /url +. +

[bar][foo!]

+```````````````````````````````` + + +[Link labels] cannot contain brackets, unless they are +backslash-escaped: + +```````````````````````````````` example +[foo][ref[] + +[ref[]: /uri +. +

[foo][ref[]

+

[ref[]: /uri

+```````````````````````````````` + + +```````````````````````````````` example +[foo][ref[bar]] + +[ref[bar]]: /uri +. +

[foo][ref[bar]]

+

[ref[bar]]: /uri

+```````````````````````````````` + + +```````````````````````````````` example +[[[foo]]] + +[[[foo]]]: /url +. +

[[[foo]]]

+

[[[foo]]]: /url

+```````````````````````````````` + + +```````````````````````````````` example +[foo][ref\[] + +[ref\[]: /uri +. +

foo

+```````````````````````````````` + + +Note that in this example `]` is not backslash-escaped: + +```````````````````````````````` example +[bar\\]: /uri + +[bar\\] +. +

bar\

+```````````````````````````````` + + +A [link label] must contain at least one character that is not a space, tab, or +line ending: + +```````````````````````````````` example +[] + +[]: /uri +. +

[]

+

[]: /uri

+```````````````````````````````` + + +```````````````````````````````` example +[ + ] + +[ + ]: /uri +. +

[ +]

+

[ +]: /uri

+```````````````````````````````` + + +A [collapsed reference link](@) +consists of a [link label] that [matches] a +[link reference definition] elsewhere in the +document, followed by the string `[]`. +The contents of the link label are parsed as inlines, +which are used as the link's text. The link's URI and title are +provided by the matching reference link definition. Thus, +`[foo][]` is equivalent to `[foo][foo]`. + +```````````````````````````````` example +[foo][] + +[foo]: /url "title" +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +[*foo* bar][] + +[*foo* bar]: /url "title" +. +

foo bar

+```````````````````````````````` + + +The link labels are case-insensitive: + +```````````````````````````````` example +[Foo][] + +[foo]: /url "title" +. +

Foo

+```````````````````````````````` + + + +As with full reference links, spaces, tabs, or line endings are not +allowed between the two sets of brackets: + +```````````````````````````````` example +[foo] +[] + +[foo]: /url "title" +. +

foo +[]

+```````````````````````````````` + + +A [shortcut reference link](@) +consists of a [link label] that [matches] a +[link reference definition] elsewhere in the +document and is not followed by `[]` or a link label. +The contents of the link label are parsed as inlines, +which are used as the link's text. The link's URI and title +are provided by the matching link reference definition. +Thus, `[foo]` is equivalent to `[foo][]`. + +```````````````````````````````` example +[foo] + +[foo]: /url "title" +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +[*foo* bar] + +[*foo* bar]: /url "title" +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +[[*foo* bar]] + +[*foo* bar]: /url "title" +. +

[foo bar]

+```````````````````````````````` + + +```````````````````````````````` example +[[bar [foo] + +[foo]: /url +. +

[[bar foo

+```````````````````````````````` + + +The link labels are case-insensitive: + +```````````````````````````````` example +[Foo] + +[foo]: /url "title" +. +

Foo

+```````````````````````````````` + + +A space after the link text should be preserved: + +```````````````````````````````` example +[foo] bar + +[foo]: /url +. +

foo bar

+```````````````````````````````` + + +If you just want bracketed text, you can backslash-escape the +opening bracket to avoid links: + +```````````````````````````````` example +\[foo] + +[foo]: /url "title" +. +

[foo]

+```````````````````````````````` + + +Note that this is a link, because a link label ends with the first +following closing bracket: + +```````````````````````````````` example +[foo*]: /url + +*[foo*] +. +

*foo*

+```````````````````````````````` + + +Full and collapsed references take precedence over shortcut +references: + +```````````````````````````````` example +[foo][bar] + +[foo]: /url1 +[bar]: /url2 +. +

foo

+```````````````````````````````` + +```````````````````````````````` example +[foo][] + +[foo]: /url1 +. +

foo

+```````````````````````````````` + +Inline links also take precedence: + +```````````````````````````````` example +[foo]() + +[foo]: /url1 +. +

foo

+```````````````````````````````` + +```````````````````````````````` example +[foo](not a link) + +[foo]: /url1 +. +

foo(not a link)

+```````````````````````````````` + +In the following case `[bar][baz]` is parsed as a reference, +`[foo]` as normal text: + +```````````````````````````````` example +[foo][bar][baz] + +[baz]: /url +. +

[foo]bar

+```````````````````````````````` + + +Here, though, `[foo][bar]` is parsed as a reference, since +`[bar]` is defined: + +```````````````````````````````` example +[foo][bar][baz] + +[baz]: /url1 +[bar]: /url2 +. +

foobaz

+```````````````````````````````` + + +Here `[foo]` is not parsed as a shortcut reference, because it +is followed by a link label (even though `[bar]` is not defined): + +```````````````````````````````` example +[foo][bar][baz] + +[baz]: /url1 +[foo]: /url2 +. +

[foo]bar

+```````````````````````````````` + + + +## Images + +Syntax for images is like the syntax for links, with one +difference. Instead of [link text], we have an +[image description](@). The rules for this are the +same as for [link text], except that (a) an +image description starts with `![` rather than `[`, and +(b) an image description may contain links. +An image description has inline elements +as its contents. When an image is rendered to HTML, +this is standardly used as the image's `alt` attribute. + +```````````````````````````````` example +![foo](/url "title") +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +![foo *bar*] + +[foo *bar*]: train.jpg "train & tracks" +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +![foo ![bar](/url)](/url2) +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +![foo [bar](/url)](/url2) +. +

foo bar

+```````````````````````````````` + + +Though this spec is concerned with parsing, not rendering, it is +recommended that in rendering to HTML, only the plain string content +of the [image description] be used. Note that in +the above example, the alt attribute's value is `foo bar`, not `foo +[bar](/url)` or `foo bar`. Only the plain string +content is rendered, without formatting. + +```````````````````````````````` example +![foo *bar*][] + +[foo *bar*]: train.jpg "train & tracks" +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +![foo *bar*][foobar] + +[FOOBAR]: train.jpg "train & tracks" +. +

foo bar

+```````````````````````````````` + + +```````````````````````````````` example +![foo](train.jpg) +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +My ![foo bar](/path/to/train.jpg "title" ) +. +

My foo bar

+```````````````````````````````` + + +```````````````````````````````` example +![foo]() +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +![](/url) +. +

+```````````````````````````````` + + +Reference-style: + +```````````````````````````````` example +![foo][bar] + +[bar]: /url +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +![foo][bar] + +[BAR]: /url +. +

foo

+```````````````````````````````` + + +Collapsed: + +```````````````````````````````` example +![foo][] + +[foo]: /url "title" +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +![*foo* bar][] + +[*foo* bar]: /url "title" +. +

foo bar

+```````````````````````````````` + + +The labels are case-insensitive: + +```````````````````````````````` example +![Foo][] + +[foo]: /url "title" +. +

Foo

+```````````````````````````````` + + +As with reference links, spaces, tabs, and line endings, are not allowed +between the two sets of brackets: + +```````````````````````````````` example +![foo] +[] + +[foo]: /url "title" +. +

foo +[]

+```````````````````````````````` + + +Shortcut: + +```````````````````````````````` example +![foo] + +[foo]: /url "title" +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +![*foo* bar] + +[*foo* bar]: /url "title" +. +

foo bar

+```````````````````````````````` + + +Note that link labels cannot contain unescaped brackets: + +```````````````````````````````` example +![[foo]] + +[[foo]]: /url "title" +. +

![[foo]]

+

[[foo]]: /url "title"

+```````````````````````````````` + + +The link labels are case-insensitive: + +```````````````````````````````` example +![Foo] + +[foo]: /url "title" +. +

Foo

+```````````````````````````````` + + +If you just want a literal `!` followed by bracketed text, you can +backslash-escape the opening `[`: + +```````````````````````````````` example +!\[foo] + +[foo]: /url "title" +. +

![foo]

+```````````````````````````````` + + +If you want a link after a literal `!`, backslash-escape the +`!`: + +```````````````````````````````` example +\![foo] + +[foo]: /url "title" +. +

!foo

+```````````````````````````````` + + +## Autolinks + +[Autolink](@)s are absolute URIs and email addresses inside +`<` and `>`. They are parsed as links, with the URL or email address +as the link label. + +A [URI autolink](@) consists of `<`, followed by an +[absolute URI] followed by `>`. It is parsed as +a link to the URI, with the URI as the link's label. + +An [absolute URI](@), +for these purposes, consists of a [scheme] followed by a colon (`:`) +followed by zero or more characters other than [ASCII control +characters][ASCII control character], [space], `<`, and `>`. +If the URI includes these characters, they must be percent-encoded +(e.g. `%20` for a space). + +For purposes of this spec, a [scheme](@) is any sequence +of 2--32 characters beginning with an ASCII letter and followed +by any combination of ASCII letters, digits, or the symbols plus +("+"), period ("."), or hyphen ("-"). + +Here are some valid autolinks: + +```````````````````````````````` example + +. +

http://foo.bar.baz

+```````````````````````````````` + + +```````````````````````````````` example + +. +

https://foo.bar.baz/test?q=hello&id=22&boolean

+```````````````````````````````` + + +```````````````````````````````` example + +. +

irc://foo.bar:2233/baz

+```````````````````````````````` + + +Uppercase is also fine: + +```````````````````````````````` example + +. +

MAILTO:FOO@BAR.BAZ

+```````````````````````````````` + + +Note that many strings that count as [absolute URIs] for +purposes of this spec are not valid URIs, because their +schemes are not registered or because of other problems +with their syntax: + +```````````````````````````````` example + +. +

a+b+c:d

+```````````````````````````````` + + +```````````````````````````````` example + +. +

made-up-scheme://foo,bar

+```````````````````````````````` + + +```````````````````````````````` example + +. +

https://../

+```````````````````````````````` + + +```````````````````````````````` example + +. +

localhost:5001/foo

+```````````````````````````````` + + +Spaces are not allowed in autolinks: + +```````````````````````````````` example + +. +

<https://foo.bar/baz bim>

+```````````````````````````````` + + +Backslash-escapes do not work inside autolinks: + +```````````````````````````````` example + +. +

https://example.com/\[\

+```````````````````````````````` + + +An [email autolink](@) +consists of `<`, followed by an [email address], +followed by `>`. The link's label is the email address, +and the URL is `mailto:` followed by the email address. + +An [email address](@), +for these purposes, is anything that matches +the [non-normative regex from the HTML5 +spec](https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)): + + /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? + (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ + +Examples of email autolinks: + +```````````````````````````````` example + +. +

foo@bar.example.com

+```````````````````````````````` + + +```````````````````````````````` example + +. +

foo+special@Bar.baz-bar0.com

+```````````````````````````````` + + +Backslash-escapes do not work inside email autolinks: + +```````````````````````````````` example + +. +

<foo+@bar.example.com>

+```````````````````````````````` + + +These are not autolinks: + +```````````````````````````````` example +<> +. +

<>

+```````````````````````````````` + + +```````````````````````````````` example +< https://foo.bar > +. +

< https://foo.bar >

+```````````````````````````````` + + +```````````````````````````````` example + +. +

<m:abc>

+```````````````````````````````` + + +```````````````````````````````` example + +. +

<foo.bar.baz>

+```````````````````````````````` + + +```````````````````````````````` example +https://example.com +. +

https://example.com

+```````````````````````````````` + + +```````````````````````````````` example +foo@bar.example.com +. +

foo@bar.example.com

+```````````````````````````````` + + +## Raw HTML + +Text between `<` and `>` that looks like an HTML tag is parsed as a +raw HTML tag and will be rendered in HTML without escaping. +Tag and attribute names are not limited to current HTML tags, +so custom tags (and even, say, DocBook tags) may be used. + +Here is the grammar for tags: + +A [tag name](@) consists of an ASCII letter +followed by zero or more ASCII letters, digits, or +hyphens (`-`). + +An [attribute](@) consists of spaces, tabs, and up to one line ending, +an [attribute name], and an optional +[attribute value specification]. + +An [attribute name](@) +consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII +letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML +specification restricted to ASCII. HTML5 is laxer.) + +An [attribute value specification](@) +consists of optional spaces, tabs, and up to one line ending, +a `=` character, optional spaces, tabs, and up to one line ending, +and an [attribute value]. + +An [attribute value](@) +consists of an [unquoted attribute value], +a [single-quoted attribute value], or a [double-quoted attribute value]. + +An [unquoted attribute value](@) +is a nonempty string of characters not +including spaces, tabs, line endings, `"`, `'`, `=`, `<`, `>`, or `` ` ``. + +A [single-quoted attribute value](@) +consists of `'`, zero or more +characters not including `'`, and a final `'`. + +A [double-quoted attribute value](@) +consists of `"`, zero or more +characters not including `"`, and a final `"`. + +An [open tag](@) consists of a `<` character, a [tag name], +zero or more [attributes], optional spaces, tabs, and up to one line ending, +an optional `/` character, and a `>` character. + +A [closing tag](@) consists of the string ``. + +An [HTML comment](@) consists of ``, ``, or ``, and `-->` (see the +[HTML spec](https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state)). + +A [processing instruction](@) +consists of the string ``, and the string +`?>`. + +A [declaration](@) consists of the string ``, and the character `>`. + +A [CDATA section](@) consists of +the string ``, and the string `]]>`. + +An [HTML tag](@) consists of an [open tag], a [closing tag], +an [HTML comment], a [processing instruction], a [declaration], +or a [CDATA section]. + +Here are some simple open tags: + +```````````````````````````````` example + +. +

+```````````````````````````````` + + +Empty elements: + +```````````````````````````````` example + +. +

+```````````````````````````````` + + +Whitespace is allowed: + +```````````````````````````````` example + +. +

+```````````````````````````````` + + +With attributes: + +```````````````````````````````` example + +. +

+```````````````````````````````` + + +Custom tag names can be used: + +```````````````````````````````` example +Foo +. +

Foo

+```````````````````````````````` + + +Illegal tag names, not parsed as HTML: + +```````````````````````````````` example +<33> <__> +. +

<33> <__>

+```````````````````````````````` + + +Illegal attribute names: + +```````````````````````````````` example +
+. +

<a h*#ref="hi">

+```````````````````````````````` + + +Illegal attribute values: + +```````````````````````````````` example +
+. +

</a href="foo">

+```````````````````````````````` + + +Comments: + +```````````````````````````````` example +foo +. +

foo

+```````````````````````````````` + +```````````````````````````````` example +foo foo --> + +foo foo --> +. +

foo foo -->

+

foo foo -->

+```````````````````````````````` + + +Processing instructions: + +```````````````````````````````` example +foo +. +

foo

+```````````````````````````````` + + +Declarations: + +```````````````````````````````` example +foo +. +

foo

+```````````````````````````````` + + +CDATA sections: + +```````````````````````````````` example +foo &<]]> +. +

foo &<]]>

+```````````````````````````````` + + +Entity and numeric character references are preserved in HTML +attributes: + +```````````````````````````````` example +foo
+. +

foo

+```````````````````````````````` + + +Backslash escapes do not work in HTML attributes: + +```````````````````````````````` example +foo +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example + +. +

<a href=""">

+```````````````````````````````` + + +## Hard line breaks + +A line ending (not in a code span or HTML tag) that is preceded +by two or more spaces and does not occur at the end of a block +is parsed as a [hard line break](@) (rendered +in HTML as a `
` tag): + +```````````````````````````````` example +foo +baz +. +

foo
+baz

+```````````````````````````````` + + +For a more visible alternative, a backslash before the +[line ending] may be used instead of two or more spaces: + +```````````````````````````````` example +foo\ +baz +. +

foo
+baz

+```````````````````````````````` + + +More than two spaces can be used: + +```````````````````````````````` example +foo +baz +. +

foo
+baz

+```````````````````````````````` + + +Leading spaces at the beginning of the next line are ignored: + +```````````````````````````````` example +foo + bar +. +

foo
+bar

+```````````````````````````````` + + +```````````````````````````````` example +foo\ + bar +. +

foo
+bar

+```````````````````````````````` + + +Hard line breaks can occur inside emphasis, links, and other constructs +that allow inline content: + +```````````````````````````````` example +*foo +bar* +. +

foo
+bar

+```````````````````````````````` + + +```````````````````````````````` example +*foo\ +bar* +. +

foo
+bar

+```````````````````````````````` + + +Hard line breaks do not occur inside code spans + +```````````````````````````````` example +`code +span` +. +

code span

+```````````````````````````````` + + +```````````````````````````````` example +`code\ +span` +. +

code\ span

+```````````````````````````````` + + +or HTML tags: + +```````````````````````````````` example +
+. +

+```````````````````````````````` + + +```````````````````````````````` example + +. +

+```````````````````````````````` + + +Hard line breaks are for separating inline content within a block. +Neither syntax for hard line breaks works at the end of a paragraph or +other block element: + +```````````````````````````````` example +foo\ +. +

foo\

+```````````````````````````````` + + +```````````````````````````````` example +foo +. +

foo

+```````````````````````````````` + + +```````````````````````````````` example +### foo\ +. +

foo\

+```````````````````````````````` + + +```````````````````````````````` example +### foo +. +

foo

+```````````````````````````````` + + +## Soft line breaks + +A regular line ending (not in a code span or HTML tag) that is not +preceded by two or more spaces or a backslash is parsed as a +[softbreak](@). (A soft line break may be rendered in HTML either as a +[line ending] or as a space. The result will be the same in +browsers. In the examples here, a [line ending] will be used.) + +```````````````````````````````` example +foo +baz +. +

foo +baz

+```````````````````````````````` + + +Spaces at the end of the line and beginning of the next line are +removed: + +```````````````````````````````` example +foo + baz +. +

foo +baz

+```````````````````````````````` + + +A conforming parser may render a soft line break in HTML either as a +line ending or as a space. + +A renderer may also provide an option to render soft line breaks +as hard line breaks. + +## Textual content + +Any characters not given an interpretation by the above rules will +be parsed as plain textual content. + +```````````````````````````````` example +hello $.;'there +. +

hello $.;'there

+```````````````````````````````` + + +```````````````````````````````` example +Foo χρῆν +. +

Foo χρῆν

+```````````````````````````````` + + +Internal spaces are preserved verbatim: + +```````````````````````````````` example +Multiple spaces +. +

Multiple spaces

+```````````````````````````````` + + + + +# Appendix: A parsing strategy + +In this appendix we describe some features of the parsing strategy +used in the CommonMark reference implementations. + +## Overview + +Parsing has two phases: + +1. In the first phase, lines of input are consumed and the block +structure of the document---its division into paragraphs, block quotes, +list items, and so on---is constructed. Text is assigned to these +blocks but not parsed. Link reference definitions are parsed and a +map of links is constructed. + +2. In the second phase, the raw text contents of paragraphs and headings +are parsed into sequences of Markdown inline elements (strings, +code spans, links, emphasis, and so on), using the map of link +references constructed in phase 1. + +At each point in processing, the document is represented as a tree of +**blocks**. The root of the tree is a `document` block. The `document` +may have any number of other blocks as **children**. These children +may, in turn, have other blocks as children. The last child of a block +is normally considered **open**, meaning that subsequent lines of input +can alter its contents. (Blocks that are not open are **closed**.) +Here, for example, is a possible document tree, with the open blocks +marked by arrows: + +``` tree +-> document + -> block_quote + paragraph + "Lorem ipsum dolor\nsit amet." + -> list (type=bullet tight=true bullet_char=-) + list_item + paragraph + "Qui *quodsi iracundia*" + -> list_item + -> paragraph + "aliquando id" +``` + +## Phase 1: block structure + +Each line that is processed has an effect on this tree. The line is +analyzed and, depending on its contents, the document may be altered +in one or more of the following ways: + +1. One or more open blocks may be closed. +2. One or more new blocks may be created as children of the + last open block. +3. Text may be added to the last (deepest) open block remaining + on the tree. + +Once a line has been incorporated into the tree in this way, +it can be discarded, so input can be read in a stream. + +For each line, we follow this procedure: + +1. First we iterate through the open blocks, starting with the +root document, and descending through last children down to the last +open block. Each block imposes a condition that the line must satisfy +if the block is to remain open. For example, a block quote requires a +`>` character. A paragraph requires a non-blank line. +In this phase we may match all or just some of the open +blocks. But we cannot close unmatched blocks yet, because we may have a +[lazy continuation line]. + +2. Next, after consuming the continuation markers for existing +blocks, we look for new block starts (e.g. `>` for a block quote). +If we encounter a new block start, we close any blocks unmatched +in step 1 before creating the new block as a child of the last +matched container block. + +3. Finally, we look at the remainder of the line (after block +markers like `>`, list markers, and indentation have been consumed). +This is text that can be incorporated into the last open +block (a paragraph, code block, heading, or raw HTML). + +Setext headings are formed when we see a line of a paragraph +that is a [setext heading underline]. + +Reference link definitions are detected when a paragraph is closed; +the accumulated text lines are parsed to see if they begin with +one or more reference link definitions. Any remainder becomes a +normal paragraph. + +We can see how this works by considering how the tree above is +generated by four lines of Markdown: + +``` markdown +> Lorem ipsum dolor +sit amet. +> - Qui *quodsi iracundia* +> - aliquando id +``` + +At the outset, our document model is just + +``` tree +-> document +``` + +The first line of our text, + +``` markdown +> Lorem ipsum dolor +``` + +causes a `block_quote` block to be created as a child of our +open `document` block, and a `paragraph` block as a child of +the `block_quote`. Then the text is added to the last open +block, the `paragraph`: + +``` tree +-> document + -> block_quote + -> paragraph + "Lorem ipsum dolor" +``` + +The next line, + +``` markdown +sit amet. +``` + +is a "lazy continuation" of the open `paragraph`, so it gets added +to the paragraph's text: + +``` tree +-> document + -> block_quote + -> paragraph + "Lorem ipsum dolor\nsit amet." +``` + +The third line, + +``` markdown +> - Qui *quodsi iracundia* +``` + +causes the `paragraph` block to be closed, and a new `list` block +opened as a child of the `block_quote`. A `list_item` is also +added as a child of the `list`, and a `paragraph` as a child of +the `list_item`. The text is then added to the new `paragraph`: + +``` tree +-> document + -> block_quote + paragraph + "Lorem ipsum dolor\nsit amet." + -> list (type=bullet tight=true bullet_char=-) + -> list_item + -> paragraph + "Qui *quodsi iracundia*" +``` + +The fourth line, + +``` markdown +> - aliquando id +``` + +causes the `list_item` (and its child the `paragraph`) to be closed, +and a new `list_item` opened up as child of the `list`. A `paragraph` +is added as a child of the new `list_item`, to contain the text. +We thus obtain the final tree: + +``` tree +-> document + -> block_quote + paragraph + "Lorem ipsum dolor\nsit amet." + -> list (type=bullet tight=true bullet_char=-) + list_item + paragraph + "Qui *quodsi iracundia*" + -> list_item + -> paragraph + "aliquando id" +``` + +## Phase 2: inline structure + +Once all of the input has been parsed, all open blocks are closed. + +We then "walk the tree," visiting every node, and parse raw +string contents of paragraphs and headings as inlines. At this +point we have seen all the link reference definitions, so we can +resolve reference links as we go. + +``` tree +document + block_quote + paragraph + str "Lorem ipsum dolor" + softbreak + str "sit amet." + list (type=bullet tight=true bullet_char=-) + list_item + paragraph + str "Qui " + emph + str "quodsi iracundia" + list_item + paragraph + str "aliquando id" +``` + +Notice how the [line ending] in the first paragraph has +been parsed as a `softbreak`, and the asterisks in the first list item +have become an `emph`. + +### An algorithm for parsing nested emphasis and links + +By far the trickiest part of inline parsing is handling emphasis, +strong emphasis, links, and images. This is done using the following +algorithm. + +When we're parsing inlines and we hit either + +- a run of `*` or `_` characters, or +- a `[` or `![` + +we insert a text node with these symbols as its literal content, and we +add a pointer to this text node to the [delimiter stack](@). + +The [delimiter stack] is a doubly linked list. Each +element contains a pointer to a text node, plus information about + +- the type of delimiter (`[`, `![`, `*`, `_`) +- the number of delimiters, +- whether the delimiter is "active" (all are active to start), and +- whether the delimiter is a potential opener, a potential closer, + or both (which depends on what sort of characters precede + and follow the delimiters). + +When we hit a `]` character, we call the *look for link or image* +procedure (see below). + +When we hit the end of the input, we call the *process emphasis* +procedure (see below), with `stack_bottom` = NULL. + +#### *look for link or image* + +Starting at the top of the delimiter stack, we look backwards +through the stack for an opening `[` or `![` delimiter. + +- If we don't find one, we return a literal text node `]`. + +- If we do find one, but it's not *active*, we remove the inactive + delimiter from the stack, and return a literal text node `]`. + +- If we find one and it's active, then we parse ahead to see if + we have an inline link/image, reference link/image, collapsed reference + link/image, or shortcut reference link/image. + + + If we don't, then we remove the opening delimiter from the + delimiter stack and return a literal text node `]`. + + + If we do, then + + * We return a link or image node whose children are the inlines + after the text node pointed to by the opening delimiter. + + * We run *process emphasis* on these inlines, with the `[` opener + as `stack_bottom`. + + * We remove the opening delimiter. + + * If we have a link (and not an image), we also set all + `[` delimiters before the opening delimiter to *inactive*. (This + will prevent us from getting links within links.) + +#### *process emphasis* + +Parameter `stack_bottom` sets a lower bound to how far we +descend in the [delimiter stack]. If it is NULL, we can +go all the way to the bottom. Otherwise, we stop before +visiting `stack_bottom`. + +Let `current_position` point to the element on the [delimiter stack] +just above `stack_bottom` (or the first element if `stack_bottom` +is NULL). + +We keep track of the `openers_bottom` for each delimiter +type (`*`, `_`), indexed to the length of the closing delimiter run +(modulo 3) and to whether the closing delimiter can also be an +opener. Initialize this to `stack_bottom`. + +Then we repeat the following until we run out of potential +closers: + +- Move `current_position` forward in the delimiter stack (if needed) + until we find the first potential closer with delimiter `*` or `_`. + (This will be the potential closer closest + to the beginning of the input -- the first one in parse order.) + +- Now, look back in the stack (staying above `stack_bottom` and + the `openers_bottom` for this delimiter type) for the + first matching potential opener ("matching" means same delimiter). + +- If one is found: + + + Figure out whether we have emphasis or strong emphasis: + if both closer and opener spans have length >= 2, we have + strong, otherwise regular. + + + Insert an emph or strong emph node accordingly, after + the text node corresponding to the opener. + + + Remove any delimiters between the opener and closer from + the delimiter stack. + + + Remove 1 (for regular emph) or 2 (for strong emph) delimiters + from the opening and closing text nodes. If they become empty + as a result, remove them and remove the corresponding element + of the delimiter stack. If the closing node is removed, reset + `current_position` to the next element in the stack. + +- If none is found: + + + Set `openers_bottom` to the element before `current_position`. + (We know that there are no openers for this kind of closer up to and + including this point, so this puts a lower bound on future searches.) + + + If the closer at `current_position` is not a potential opener, + remove it from the delimiter stack (since we know it can't + be a closer either). + + + Advance `current_position` to the next element in the stack. + +After we're done, we remove all delimiters above `stack_bottom` from the +delimiter stack. diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc2854-text-html.txt b/docs/research/non-pdf-dom-evidence/standards/rfc2854-text-html.txt new file mode 100644 index 000000000..ad1e0f770 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc2854-text-html.txt @@ -0,0 +1,451 @@ + + + + + + +Network Working Group D. Connolly +Request for Comments: 2854 World Wide Web Consortium (W3C) +Obsoletes: 2070, 1980, 1942, 1867, 1866 L. Masinter +Category: Informational AT&T + June 2000 + + + The 'text/html' Media Type + +Status of this Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard of any kind. Distribution of this + memo is unlimited. + +Copyright Notice + + Copyright (C) The Internet Society (2000). All Rights Reserved. + +Abstract + + This document summarizes the history of HTML development, and defines + the "text/html" MIME type by pointing to the relevant W3C + recommendations; it is intended to obsolete the previous IETF + documents defining HTML, including RFC 1866, RFC 1867, RFC 1980, RFC + 1942 and RFC 2070, and to remove HTML from IETF Standards Track. + + This document was prepared at the request of the W3C HTML working + group. Please send comments to www-html@w3.org, a public mailing list + with archive at . + +1. Introduction and background + + HTML has been in use in the World Wide Web information infrastructure + since 1990, and specified in various informal documents. The + text/html media type was first officially defined by the IETF HTML + working group in 1995 in [HTML20]. Extensions to HTML were proposed + in [HTML30], [UPLOAD], [TABLES], [CLIMAPS], and [I18N]. + + The IETF HTML working group closed Sep 1996, and work on defining + HTML moved to the World Wide Web Consortium (W3C). The proposed + extensions were incorporated to some extent in [HTML32], and to a + larger extent in [HTML40]. The definition of multipart/form-data from + [UPLOAD] was described in [FORMDATA]. In addition, a reformulation of + HTML 4.0 in XML 1.0[XHTML1] was developed. + + + + + + +Connolly & Masinter Informational [Page 1] + +RFC 2854 The 'text/html' Media Type June 2000 + + + [HTML32] notes "This specification defines HTML version 3.2. HTML 3.2 + aims to capture recommended practice as of early '96 and as such to + be used as a replacement for HTML 2.0 (RFC 1866)." Subsequent + specifications for HTML describe the differences in each version. + + In addition to the development of standards, a wide variety of + additional extensions, restrictions, and modifications to HTML were + popularized by NCSA's Mosaic system and subsequently by the + competitive implementations of Netscape Navigator and Microsoft + Internet Explorer; these extensions are documented in numerous books + and online guides. + +2. Registration of MIME media type text/html + + MIME media type name: text + MIME subtype name: html + Required parameters: none + Optional parameters: + + charset + The optional parameter "charset" refers to the character + encoding used to represent the HTML document as a sequence of + bytes. Any registered IANA charset may be used, but UTF-8 is + preferred. Although this parameter is optional, it is strongly + recommended that it always be present. See Section 6 below for + a discussion of charset default rules. + + Note that [HTML20] included an optional "level" parameter; in + practice, this parameter was never used and has been removed from + this specification. [HTML30] also suggested a "version" + parameter; in practice, this parameter also was never used and has + been removed from this specification. + + Encoding considerations: + See Section 4 of this document. + + Security considerations: + See Section 7 of this document. + + Interoperability considerations: + HTML is designed to be interoperable across the widest possible + range of platforms and devices of varying capabilities. However, + there are contexts (platforms of limited display capability, for + example) where not all of the capabilities of the full HTML + definition are feasible. There is ongoing work to develop both a + modularization of HTML and a set of profiling capabilities to + identify and negotiate restricted (and extended) capabilities. + + + + +Connolly & Masinter Informational [Page 2] + +RFC 2854 The 'text/html' Media Type June 2000 + + + Due to the long and distributed development of HTML, current + practice on the Internet includes a wide variety of HTML variants. + Implementors of text/html interpreters must be prepared to be + "bug-compatible" with popular browsers in order to work with many + HTML documents available the Internet. + + Typically, different versions are distinguishable by the DOCTYPE + declaration contained within them, although the DOCTYPE + declaration itself is sometimes omitted or incorrect. + + Published specification: + The text/html media type is now defined by W3C Recommendations; + the latest published version is [HTML401]. In addition, [XHTML1] + defines a profile of use of XHTML which is compatible with HTML + 4.01 and which may also be labeled as text/html. + + Applications which use this media type: + The first and most common application of HTML is the World Wide + Web; commonly, HTML documents contain URI references [URI] to + other documents and media to be retrieved using the HTTP protocol + [HTTP]. Many gateway applications provide HTML-based interfaces to + other underlying complex services. Numerous other applications now + also use HTML as a convenient platform-independent multimedia + document representation. + + Additional information: + + Magic number: + There is no single initial string that is always present for + HTML files. However, Section 5 below gives some guidelines for + recognizing HTML files. + + File extension: + The file extensions 'html' or 'htm' are commonly used, but + other extensions denoting file formats for preprocessing are + also common. + + Macintosh File Type code: TEXT + + Person & email address to contact for further information: + Dan Connolly + Larry Masinter + + + + + + + + + +Connolly & Masinter Informational [Page 3] + +RFC 2854 The 'text/html' Media Type June 2000 + + + Intended usage: COMMON + + Author/Change controller: + The HTML specification is a work product of the World Wide Web + Consortium's HTML Working Group. The W3C has change control over + the HTML specification. + + Further information: + HTML has a means of including, by reference via URI, additional + resources (image, video clip, applet) within the base document. In + order to transfer a complete HTML object and the included + resources in a single MIME object, the mechanisms of [MHTML] may + be used. + +3. Fragment Identifiers + + The URI specification [URI] notes that the semantics of a fragment + identifier (part of a URI after a "#") is a property of the data + resulting from a retrieval action, and that the format and + interpretation of fragment identifiers is dependent on the media type + of the retrieval result. + + For documents labeled as text/html, the fragment identifier + designates the correspondingly named element; any element may be + named with the "id" attribute, and A, APPLET, FRAME, IFRAME, IMG and + MAP elements may be named with a "name" attribute. This is described + in detail in [HTML40] section 12. + +4. Encoding considerations + + Because of the availability within HTML itself for using character + entity references, documents that use a wide repertoire of characters + may still be represented using the US-ASCII charset and transported + without encoding. However, transport of text/html using a charset + other than US-ASCII may require base64 or quoted-printable encoding + for 7-bit channels. + + As with all MIME text subtypes, the canonical form of "text/html" + must always represent a line break as a sequence of a CR byte value + (0x0D) followed by an LF (0x0A) byte value. Similarly, any + occurrence of such a CRLF sequence in "text/html" must represent a + line break. Use of CR byte values and LF byte values outside of line + break sequences is also forbidden. This rule applies regardless of + the character encoding ('charset') involved. + + + + + + + +Connolly & Masinter Informational [Page 4] + +RFC 2854 The 'text/html' Media Type June 2000 + + + Note, however, that the HTTP protocol allows the transport of data + not in canonical form, and, in particular, with other end-of-line + conventions; see [HTTP] section 3.7.1. This exception is commonly + used for HTML. + + HTML sent via email is still subject to the MIME restrictions; this + is discussed fully in [MHTML] Section 10. + +5. Recognizing HTML files + + Almost all HTML files have the string "). + + + + + +Connolly & Masinter Informational [Page 6] + +RFC 2854 The 'text/html' Media Type June 2000 + + + [HTML32] Raggett, D., "HTML 3.2 Reference Specification", W3C + Recomendation, January 1997. + Available at . + + [HTML40] Raggett, D., et al., "HTML 4.0 Specification", W3C + Recommendation, December 1997. + Available at + + [HTML401] Raggett, D., et al., "HTML 4.01 Specification", W3C + Recommendation, December 1999. + Available at . + + [HTTP] Gettys, J., Fielding, R., Mogul, J., Frystyk, H., + Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext + Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. + + [I18N] Yergeau, F., Nicol, G. and M. Duerst, + "Internationalization of the Hypertext Markup Language", + RFC 2070, January 1997. + + [MHTML] Palme, J., Hotmann, A. and N. Shelness, "MIME + Encapsulation of Aggregate Documents, such as HTML + (MHTML)", RFC 2557, March 1999. + + [MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types", RFC 2046, + November 1996. + + [TABLES] Raggett, D., "HTML Tables", RFC 1942, May 1996. + + [UPLOAD] Nebel, E. and L. Masinter, "Form-based File Upload in + HTML", RFC 1867, November 1995. + + [URI] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform + Resource Identifiers (URI): Generic Syntax", RFC 2396, + August 1998. + + [XHTML1] "XHTML 1.0: The Extensible HyperText Markup Language: A + Reformulation of HTML 4 in XML 1.0", W3C Recommendation, + January 2000. Available at . + + + + + + + + + + +Connolly & Masinter Informational [Page 7] + +RFC 2854 The 'text/html' Media Type June 2000 + + +10. Full Copyright Statement + + Copyright (C) The Internet Society (2000). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +Acknowledgement + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + + + + + + + + + + + + + + + + +Connolly & Masinter Informational [Page 8] + diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc4180-csv.txt b/docs/research/non-pdf-dom-evidence/standards/rfc4180-csv.txt new file mode 100644 index 000000000..87f343dba --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc4180-csv.txt @@ -0,0 +1,451 @@ + + + + + + +Network Working Group Y. Shafranovich +Request for Comments: 4180 SolidMatrix Technologies, Inc. +Category: Informational October 2005 + + + Common Format and MIME Type for Comma-Separated Values (CSV) Files + +Status of This Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard of any kind. Distribution of this + memo is unlimited. + +Copyright Notice + + Copyright (C) The Internet Society (2005). + +Abstract + + This RFC documents the format used for Comma-Separated Values (CSV) + files and registers the associated MIME type "text/csv". + +Table of Contents + + 1. Introduction ....................................................2 + 2. Definition of the CSV Format ....................................2 + 3. MIME Type Registration of text/csv ..............................4 + 4. IANA Considerations .............................................5 + 5. Security Considerations .........................................5 + 6. Acknowledgments .................................................6 + 7. References ......................................................6 + 7.1. Normative References .......................................6 + 7.2. Informative References .....................................6 + + + + + + + + + + + + + + + + + + +Shafranovich Informational [Page 1] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + +1. Introduction + + The comma separated values format (CSV) has been used for exchanging + and converting data between various spreadsheet programs for quite + some time. Surprisingly, while this format is very common, it has + never been formally documented. Additionally, while the IANA MIME + registration tree includes a registration for + "text/tab-separated-values" type, no MIME types have ever been + registered with IANA for CSV. At the same time, various programs and + operating systems have begun to use different MIME types for this + format. This RFC documents the format of comma separated values + (CSV) files and formally registers the "text/csv" MIME type for CSV + in accordance with RFC 2048 [1]. + +2. Definition of the CSV Format + + While there are various specifications and implementations for the + CSV format (for ex. [4], [5], [6] and [7]), there is no formal + specification in existence, which allows for a wide variety of + interpretations of CSV files. This section documents the format that + seems to be followed by most implementations: + + 1. Each record is located on a separate line, delimited by a line + break (CRLF). For example: + + aaa,bbb,ccc CRLF + zzz,yyy,xxx CRLF + + 2. The last record in the file may or may not have an ending line + break. For example: + + aaa,bbb,ccc CRLF + zzz,yyy,xxx + + 3. There maybe an optional header line appearing as the first line + of the file with the same format as normal record lines. This + header will contain names corresponding to the fields in the file + and should contain the same number of fields as the records in + the rest of the file (the presence or absence of the header line + should be indicated via the optional "header" parameter of this + MIME type). For example: + + field_name,field_name,field_name CRLF + aaa,bbb,ccc CRLF + zzz,yyy,xxx CRLF + + + + + + +Shafranovich Informational [Page 2] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + + 4. Within the header and each record, there may be one or more + fields, separated by commas. Each line should contain the same + number of fields throughout the file. Spaces are considered part + of a field and should not be ignored. The last field in the + record must not be followed by a comma. For example: + + aaa,bbb,ccc + + 5. Each field may or may not be enclosed in double quotes (however + some programs, such as Microsoft Excel, do not use double quotes + at all). If fields are not enclosed with double quotes, then + double quotes may not appear inside the fields. For example: + + "aaa","bbb","ccc" CRLF + zzz,yyy,xxx + + 6. Fields containing line breaks (CRLF), double quotes, and commas + should be enclosed in double-quotes. For example: + + "aaa","b CRLF + bb","ccc" CRLF + zzz,yyy,xxx + + 7. If double-quotes are used to enclose fields, then a double-quote + appearing inside a field must be escaped by preceding it with + another double quote. For example: + + "aaa","b""bb","ccc" + + The ABNF grammar [2] appears as follows: + + file = [header CRLF] record *(CRLF record) [CRLF] + + header = name *(COMMA name) + + record = field *(COMMA field) + + name = field + + field = (escaped / non-escaped) + + escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE + + non-escaped = *TEXTDATA + + COMMA = %x2C + + CR = %x0D ;as per section 6.1 of RFC 2234 [2] + + + +Shafranovich Informational [Page 3] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + + DQUOTE = %x22 ;as per section 6.1 of RFC 2234 [2] + + LF = %x0A ;as per section 6.1 of RFC 2234 [2] + + CRLF = CR LF ;as per section 6.1 of RFC 2234 [2] + + TEXTDATA = %x20-21 / %x23-2B / %x2D-7E + +3. MIME Type Registration of text/csv + + This section provides the media-type registration application (as per + RFC 2048 [1]. + + To: ietf-types@iana.org + + Subject: Registration of MIME media type text/csv + + MIME media type name: text + + MIME subtype name: csv + + Required parameters: none + + Optional parameters: charset, header + + Common usage of CSV is US-ASCII, but other character sets defined + by IANA for the "text" tree may be used in conjunction with the + "charset" parameter. + + The "header" parameter indicates the presence or absence of the + header line. Valid values are "present" or "absent". + Implementors choosing not to use this parameter must make their + own decisions as to whether the header line is present or absent. + + Encoding considerations: + + As per section 4.1.1. of RFC 2046 [3], this media type uses CRLF + to denote line breaks. However, implementors should be aware that + some implementations may use other values. + + Security considerations: + + CSV files contain passive text data that should not pose any + risks. However, it is possible in theory that malicious binary + data may be included in order to exploit potential buffer overruns + in the program processing CSV data. Additionally, private data + may be shared via this format (which of course applies to any text + data). + + + +Shafranovich Informational [Page 4] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + + Interoperability considerations: + + Due to lack of a single specification, there are considerable + differences among implementations. Implementors should "be + conservative in what you do, be liberal in what you accept from + others" (RFC 793 [8]) when processing CSV files. An attempt at a + common definition can be found in Section 2. + + Implementations deciding not to use the optional "header" + parameter must make their own decision as to whether the header is + absent or present. + + Published specification: + + While numerous private specifications exist for various programs + and systems, there is no single "master" specification for this + format. An attempt at a common definition can be found in Section + 2. + + Applications that use this media type: + + Spreadsheet programs and various data conversion utilities + + Additional information: + + Magic number(s): none + + File extension(s): CSV + + Macintosh File Type Code(s): TEXT + + Person & email address to contact for further information: + + Yakov Shafranovich + + Intended usage: COMMON + + Author/Change controller: IESG + +4. IANA Considerations + + The IANA has registered the MIME type "text/csv" using the + application provided in Section 3 of this document. + +5. Security Considerations + + See discussion above in section 3. + + + + +Shafranovich Informational [Page 5] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + +6. Acknowledgments + + The author would like to thank Dave Crocker, Martin Duerst, Joel M. + Halpern, Clyde Ingram, Graham Klyne, Bruce Lilly, Chris Lilley, and + members of the IESG for their helpful suggestions. A special word of + thanks goes to Dave for helping with the ABNF grammar. + + The author would also like to thank Henrik Lefkowetz, Marshall Rose, + and the folks at xml.resource.org for providing many of the tools + used for preparing RFCs and Internet drafts. + + A special thank you goes to L.T.S. + +7. References + +7.1. Normative References + + [1] Freed, N., Klensin, J., and J. Postel, "Multipurpose Internet + Mail Extensions (MIME) Part Four: Registration Procedures", BCP + 13, RFC 2048, November 1996. + + [2] Crocker, D. and P. Overell, "Augmented BNF for Syntax + Specifications: ABNF", RFC 2234, November 1997. + + [3] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types", RFC 2046, November + 1996. + +7.2. Informative References + + [4] Repici, J., "HOW-TO: The Comma Separated Value (CSV) File + Format", 2004, + . + + [5] Edoceo, Inc., "CSV Standard File Format", 2004, + . + + [6] Rodger, R. and O. Shanaghy, "Documentation for Ricebridge CSV + Manager", February 2005, + . + + [7] Raymond, E., "The Art of Unix Programming, Chapter 5", September + 2003, + . + + [8] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, + September 1981. + + + + +Shafranovich Informational [Page 6] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + +Author's Address + + Yakov Shafranovich + SolidMatrix Technologies, Inc. + + EMail: ietf@shaftek.org + URI: http://www.shaftek.org + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Shafranovich Informational [Page 7] + +RFC 4180 Common Format and MIME Type for CSV Files October 2005 + + +Full Copyright Statement + + Copyright (C) The Internet Society (2005). + + This document is subject to the rights, licenses and restrictions + contained in BCP 78, and except as set forth therein, the authors + retain all their rights. + + This document and the information contained herein are provided on an + "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS + OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET + ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE + INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +Intellectual Property + + The IETF takes no position regarding the validity or scope of any + Intellectual Property Rights or other rights that might be claimed to + pertain to the implementation or use of the technology described in + this document or the extent to which any license under such rights + might or might not be available; nor does it represent that it has + made any independent effort to identify any such rights. Information + on the procedures with respect to rights in RFC documents can be + found in BCP 78 and BCP 79. + + Copies of IPR disclosures made to the IETF Secretariat and any + assurances of licenses to be made available, or the result of an + attempt made to obtain a general license or permission for the use of + such proprietary rights by implementers or users of this + specification can be obtained from the IETF on-line IPR repository at + http://www.ietf.org/ipr. + + The IETF invites any interested party to bring to its attention any + copyrights, patents or patent applications, or other proprietary + rights that may cover technology that may be required to implement + this standard. Please address the information to the IETF at ietf- + ipr@ietf.org. + +Acknowledgement + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + + + + +Shafranovich Informational [Page 8] + diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc5545-icalendar.txt b/docs/research/non-pdf-dom-evidence/standards/rfc5545-icalendar.txt new file mode 100644 index 000000000..47ea31d60 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc5545-icalendar.txt @@ -0,0 +1,9411 @@ + + + + + + +Network Working Group B. Desruisseaux, Ed. +Request for Comments: 5545 Oracle +Obsoletes: 2445 September 2009 +Category: Standards Track + + + Internet Calendaring and Scheduling Core Object Specification + (iCalendar) + +Abstract + +This document defines the iCalendar data format for representing and +exchanging calendaring and scheduling information such as events, +to-dos, journal entries, and free/busy information, independent of any +particular calendar service or protocol. + +Status of This Memo + + This document specifies an Internet standards track protocol for the + Internet community, and requests discussion and suggestions for + improvements. Please refer to the current edition of the "Internet + Official Protocol Standards" (STD 1) for the standardization state + and status of this protocol. Distribution of this memo is unlimited. + +Copyright and License Notice + + Copyright (c) 2009 IETF Trust and the persons identified as the + document authors. All rights reserved. + + This document is subject to BCP 78 and the IETF Trust's Legal + Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info) in effect on the date of + publication of this document. Please review these documents + carefully, as they describe your rights and restrictions with respect + to this document. Code Components extracted from this document must + include Simplified BSD License text as described in Section 4.e of + the Trust Legal Provisions and are provided without warranty as + described in the BSD License. + + This document may contain material from IETF Documents or IETF + Contributions published or made publicly available before November + 10, 2008. The person(s) controlling the copyright in some of this + material may not have granted the IETF Trust the right to allow + modifications of such material outside the IETF Standards Process. + Without obtaining an adequate license from the person(s) controlling + the copyright in such materials, this document may not be modified + outside the IETF Standards Process, and derivative works of it may + not be created outside the IETF Standards Process, except to format + + + +Desruisseaux Standards Track [Page 1] + +RFC 5545 iCalendar September 2009 + + + it for publication as an RFC or to translate it into languages other + than English. + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 + 2. Basic Grammar and Conventions . . . . . . . . . . . . . . . . 6 + 2.1. Formatting Conventions . . . . . . . . . . . . . . . . . 6 + 2.2. Related Memos . . . . . . . . . . . . . . . . . . . . . . 7 + 3. iCalendar Object Specification . . . . . . . . . . . . . . . 8 + 3.1. Content Lines . . . . . . . . . . . . . . . . . . . . . . 8 + 3.1.1. List and Field Separators . . . . . . . . . . . . . . 11 + 3.1.2. Multiple Values . . . . . . . . . . . . . . . . . . . 11 + 3.1.3. Binary Content . . . . . . . . . . . . . . . . . . . 11 + 3.1.4. Character Set . . . . . . . . . . . . . . . . . . . . 12 + 3.2. Property Parameters . . . . . . . . . . . . . . . . . . . 12 + 3.2.1. Alternate Text Representation . . . . . . . . . . . . 13 + 3.2.2. Common Name . . . . . . . . . . . . . . . . . . . . . 15 + 3.2.3. Calendar User Type . . . . . . . . . . . . . . . . . 15 + 3.2.4. Delegators . . . . . . . . . . . . . . . . . . . . . 16 + 3.2.5. Delegatees . . . . . . . . . . . . . . . . . . . . . 16 + 3.2.6. Directory Entry Reference . . . . . . . . . . . . . . 17 + 3.2.7. Inline Encoding . . . . . . . . . . . . . . . . . . . 17 + 3.2.8. Format Type . . . . . . . . . . . . . . . . . . . . . 18 + 3.2.9. Free/Busy Time Type . . . . . . . . . . . . . . . . . 19 + 3.2.10. Language . . . . . . . . . . . . . . . . . . . . . . 20 + 3.2.11. Group or List Membership . . . . . . . . . . . . . . 20 + 3.2.12. Participation Status . . . . . . . . . . . . . . . . 21 + 3.2.13. Recurrence Identifier Range . . . . . . . . . . . . . 22 + 3.2.14. Alarm Trigger Relationship . . . . . . . . . . . . . 23 + 3.2.15. Relationship Type . . . . . . . . . . . . . . . . . . 24 + 3.2.16. Participation Role . . . . . . . . . . . . . . . . . 25 + 3.2.17. RSVP Expectation . . . . . . . . . . . . . . . . . . 25 + 3.2.18. Sent By . . . . . . . . . . . . . . . . . . . . . . . 26 + 3.2.19. Time Zone Identifier . . . . . . . . . . . . . . . . 26 + 3.2.20. Value Data Types . . . . . . . . . . . . . . . . . . 28 + 3.3. Property Value Data Types . . . . . . . . . . . . . . . . 29 + 3.3.1. Binary . . . . . . . . . . . . . . . . . . . . . . . 29 + 3.3.2. Boolean . . . . . . . . . . . . . . . . . . . . . . . 30 + 3.3.3. Calendar User Address . . . . . . . . . . . . . . . . 30 + 3.3.4. Date . . . . . . . . . . . . . . . . . . . . . . . . 31 + 3.3.5. Date-Time . . . . . . . . . . . . . . . . . . . . . . 31 + 3.3.6. Duration . . . . . . . . . . . . . . . . . . . . . . 34 + 3.3.7. Float . . . . . . . . . . . . . . . . . . . . . . . . 35 + 3.3.8. Integer . . . . . . . . . . . . . . . . . . . . . . . 35 + 3.3.9. Period of Time . . . . . . . . . . . . . . . . . . . 36 + 3.3.10. Recurrence Rule . . . . . . . . . . . . . . . . . . . 37 + 3.3.11. Text . . . . . . . . . . . . . . . . . . . . . . . . 45 + + + +Desruisseaux Standards Track [Page 2] + +RFC 5545 iCalendar September 2009 + + + 3.3.12. Time . . . . . . . . . . . . . . . . . . . . . . . . 46 + 3.3.13. URI . . . . . . . . . . . . . . . . . . . . . . . . . 48 + 3.3.14. UTC Offset . . . . . . . . . . . . . . . . . . . . . 49 + 3.4. iCalendar Object . . . . . . . . . . . . . . . . . . . . 49 + 3.5. Property . . . . . . . . . . . . . . . . . . . . . . . . 50 + 3.6. Calendar Components . . . . . . . . . . . . . . . . . . . 50 + 3.6.1. Event Component . . . . . . . . . . . . . . . . . . . 52 + 3.6.2. To-Do Component . . . . . . . . . . . . . . . . . . . 56 + 3.6.3. Journal Component . . . . . . . . . . . . . . . . . . 58 + 3.6.4. Free/Busy Component . . . . . . . . . . . . . . . . . 60 + 3.6.5. Time Zone Component . . . . . . . . . . . . . . . . . 63 + 3.6.6. Alarm Component . . . . . . . . . . . . . . . . . . . 72 + 3.7. Calendar Properties . . . . . . . . . . . . . . . . . . . 77 + 3.7.1. Calendar Scale . . . . . . . . . . . . . . . . . . . 77 + 3.7.2. Method . . . . . . . . . . . . . . . . . . . . . . . 78 + 3.7.3. Product Identifier . . . . . . . . . . . . . . . . . 79 + 3.7.4. Version . . . . . . . . . . . . . . . . . . . . . . . 80 + 3.8. Component Properties . . . . . . . . . . . . . . . . . . 81 + 3.8.1. Descriptive Component Properties . . . . . . . . . . 81 + 3.8.1.1. Attachment . . . . . . . . . . . . . . . . . . . 81 + 3.8.1.2. Categories . . . . . . . . . . . . . . . . . . . 82 + 3.8.1.3. Classification . . . . . . . . . . . . . . . . . 83 + 3.8.1.4. Comment . . . . . . . . . . . . . . . . . . . . . 84 + 3.8.1.5. Description . . . . . . . . . . . . . . . . . . . 85 + 3.8.1.6. Geographic Position . . . . . . . . . . . . . . . 87 + 3.8.1.7. Location . . . . . . . . . . . . . . . . . . . . 88 + 3.8.1.8. Percent Complete . . . . . . . . . . . . . . . . 89 + 3.8.1.9. Priority . . . . . . . . . . . . . . . . . . . . 90 + 3.8.1.10. Resources . . . . . . . . . . . . . . . . . . . . 92 + 3.8.1.11. Status . . . . . . . . . . . . . . . . . . . . . 93 + 3.8.1.12. Summary . . . . . . . . . . . . . . . . . . . . . 94 + 3.8.2. Date and Time Component Properties . . . . . . . . . 95 + 3.8.2.1. Date-Time Completed . . . . . . . . . . . . . . . 95 + 3.8.2.2. Date-Time End . . . . . . . . . . . . . . . . . . 96 + 3.8.2.3. Date-Time Due . . . . . . . . . . . . . . . . . . 97 + 3.8.2.4. Date-Time Start . . . . . . . . . . . . . . . . . 99 + 3.8.2.5. Duration . . . . . . . . . . . . . . . . . . . . 100 + 3.8.2.6. Free/Busy Time . . . . . . . . . . . . . . . . . 101 + 3.8.2.7. Time Transparency . . . . . . . . . . . . . . . . 102 + 3.8.3. Time Zone Component Properties . . . . . . . . . . . 103 + 3.8.3.1. Time Zone Identifier . . . . . . . . . . . . . . 103 + 3.8.3.2. Time Zone Name . . . . . . . . . . . . . . . . . 105 + 3.8.3.3. Time Zone Offset From . . . . . . . . . . . . . . 106 + 3.8.3.4. Time Zone Offset To . . . . . . . . . . . . . . . 106 + 3.8.3.5. Time Zone URL . . . . . . . . . . . . . . . . . . 107 + 3.8.4. Relationship Component Properties . . . . . . . . . . 108 + 3.8.4.1. Attendee . . . . . . . . . . . . . . . . . . . . 108 + 3.8.4.2. Contact . . . . . . . . . . . . . . . . . . . . . 111 + + + +Desruisseaux Standards Track [Page 3] + +RFC 5545 iCalendar September 2009 + + + 3.8.4.3. Organizer . . . . . . . . . . . . . . . . . . . . 113 + 3.8.4.4. Recurrence ID . . . . . . . . . . . . . . . . . . 114 + 3.8.4.5. Related To . . . . . . . . . . . . . . . . . . . 117 + 3.8.4.6. Uniform Resource Locator . . . . . . . . . . . . 118 + 3.8.4.7. Unique Identifier . . . . . . . . . . . . . . . . 119 + 3.8.5. Recurrence Component Properties . . . . . . . . . . . 120 + 3.8.5.1. Exception Date-Times . . . . . . . . . . . . . . 120 + 3.8.5.2. Recurrence Date-Times . . . . . . . . . . . . . . 122 + 3.8.5.3. Recurrence Rule . . . . . . . . . . . . . . . . . 124 + 3.8.6. Alarm Component Properties . . . . . . . . . . . . . 134 + 3.8.6.1. Action . . . . . . . . . . . . . . . . . . . . . 134 + 3.8.6.2. Repeat Count . . . . . . . . . . . . . . . . . . 135 + 3.8.6.3. Trigger . . . . . . . . . . . . . . . . . . . . . 135 + 3.8.7. Change Management Component Properties . . . . . . . 138 + 3.8.7.1. Date-Time Created . . . . . . . . . . . . . . . . 138 + 3.8.7.2. Date-Time Stamp . . . . . . . . . . . . . . . . . 139 + 3.8.7.3. Last Modified . . . . . . . . . . . . . . . . . . 140 + 3.8.7.4. Sequence Number . . . . . . . . . . . . . . . . . 141 + 3.8.8. Miscellaneous Component Properties . . . . . . . . . 142 + 3.8.8.1. IANA Properties . . . . . . . . . . . . . . . . . 142 + 3.8.8.2. Non-Standard Properties . . . . . . . . . . . . . 142 + 3.8.8.3. Request Status . . . . . . . . . . . . . . . . . 144 + 4. iCalendar Object Examples . . . . . . . . . . . . . . . . . . 146 + 5. Recommended Practices . . . . . . . . . . . . . . . . . . . . 150 + 6. Internationalization Considerations . . . . . . . . . . . . . 151 + 7. Security Considerations . . . . . . . . . . . . . . . . . . . 151 + 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 151 + 8.1. iCalendar Media Type Registration . . . . . . . . . . . . 151 + 8.2. New iCalendar Elements Registration . . . . . . . . . . . 155 + 8.2.1. iCalendar Elements Registration Procedure . . . . . . 155 + 8.2.2. Registration Template for Components . . . . . . . . 155 + 8.2.3. Registration Template for Properties . . . . . . . . 156 + 8.2.4. Registration Template for Parameters . . . . . . . . 156 + 8.2.5. Registration Template for Value Data Types . . . . . 157 + 8.2.6. Registration Template for Values . . . . . . . . . . 157 + 8.3. Initial iCalendar Elements Registries . . . . . . . . . . 158 + 8.3.1. Components Registry . . . . . . . . . . . . . . . . . 158 + 8.3.2. Properties Registry . . . . . . . . . . . . . . . . . 158 + 8.3.3. Parameters Registry . . . . . . . . . . . . . . . . . 161 + 8.3.4. Value Data Types Registry . . . . . . . . . . . . . . 162 + 8.3.5. Calendar User Types Registry . . . . . . . . . . . . 162 + 8.3.6. Free/Busy Time Types Registry . . . . . . . . . . . . 163 + 8.3.7. Participation Statuses Registry . . . . . . . . . . . 163 + 8.3.8. Relationship Types Registry . . . . . . . . . . . . . 164 + 8.3.9. Participation Roles Registry . . . . . . . . . . . . 164 + 8.3.10. Actions Registry . . . . . . . . . . . . . . . . . . 165 + 8.3.11. Classifications Registry . . . . . . . . . . . . . . 165 + 8.3.12. Methods Registry . . . . . . . . . . . . . . . . . . 165 + + + +Desruisseaux Standards Track [Page 4] + +RFC 5545 iCalendar September 2009 + + + 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 165 + 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 166 + 10.1. Normative References . . . . . . . . . . . . . . . . . . 166 + 10.2. Informative References . . . . . . . . . . . . . . . . . 167 + Appendix A. Differences from RFC 2445 . . . . . . . . . . . . . 169 + A.1. New Restrictions . . . . . . . . . . . . . . . . . . . . 169 + A.2. Restrictions Removed . . . . . . . . . . . . . . . . . . 169 + A.3. Deprecated Features . . . . . . . . . . . . . . . . . . . 169 + +1. Introduction + + The use of calendaring and scheduling has grown considerably in the + last decade. Enterprise and inter-enterprise business has become + dependent on rapid scheduling of events and actions using this + information technology. This memo is intended to progress the level + of interoperability possible between dissimilar calendaring and + scheduling applications. This memo defines a MIME content type for + exchanging electronic calendaring and scheduling information. The + Internet Calendaring and Scheduling Core Object Specification, or + iCalendar, allows for the capture and exchange of information + normally stored within a calendaring and scheduling application; such + as a Personal Information Manager (PIM) or a Group-Scheduling + product. + + The iCalendar format is suitable as an exchange format between + applications or systems. The format is defined in terms of a MIME + content type. This will enable the object to be exchanged using + several transports, including but not limited to SMTP, HTTP, a file + system, desktop interactive protocols such as the use of a memory- + based clipboard or drag/drop interactions, point-to-point + asynchronous communication, wired-network transport, or some form of + unwired transport such as infrared. + + The memo also provides for the definition of iCalendar object methods + that will map this content type to a set of messages for supporting + calendaring and scheduling operations such as requesting, replying + to, modifying, and canceling meetings or appointments, to-dos, and + journal entries. The iCalendar object methods can be used to define + other calendaring and scheduling operations such as requesting for + and replying with free/busy time data. Such a scheduling protocol is + defined in the iCalendar Transport-independent Interoperability + Protocol (iTIP) defined in [2446bis]. + + The memo also includes a formal grammar for the content type based on + the Internet ABNF defined in [RFC5234]. This ABNF is required for + the implementation of parsers and to serve as the definitive + reference when ambiguities or questions arise in interpreting the + descriptive prose definition of the memo. Additional restrictions + + + +Desruisseaux Standards Track [Page 5] + +RFC 5545 iCalendar September 2009 + + + that could not easily be expressed with the ABNF syntax are specified + as comments in the ABNF. Comments with normative statements should + be treated as such. + +2. Basic Grammar and Conventions + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in [RFC2119]. + + This memo makes use of both a descriptive prose and a more formal + notation for defining the calendaring and scheduling format. + + The notation used in this memo is the ABNF notation of [RFC5234]. + Readers intending on implementing the format defined in this memo + should be familiar with this notation in order to properly interpret + the specifications of this memo. + + All numeric values used in this memo are given in decimal notation. + + All names of properties, property parameters, enumerated property + values, and property parameter values are case-insensitive. However, + all other property values are case-sensitive, unless otherwise + stated. + + Note: All indented editorial notes, such as this one, are intended + to provide the reader with additional information. The + information is not essential to the building of an implementation + conformant with this memo. The information is provided to + highlight a particular feature or characteristic of the memo. + + The format for the iCalendar object is based on the syntax of the + text/directory media type [RFC2425]. While the iCalendar object is + not a profile of the text/directory media type [RFC2425], it does + reuse a number of the elements from the [RFC2425] specification. + +2.1. Formatting Conventions + + The elements defined in this memo are defined in prose. Many of the + terms used to describe these have common usage that is different than + the standards usage of this memo. In order to reference, within this + memo, elements of the calendaring and scheduling model, core object + (this memo), or interoperability protocol [2446bis] some formatting + conventions have been used. Calendaring and scheduling roles are + referred to in quoted-strings of text with the first character of + each word in uppercase. For example, "Organizer" refers to a role of + a "Calendar User" within the scheduling protocol defined by + [2446bis]. Calendar components defined by this memo are referred to + + + +Desruisseaux Standards Track [Page 6] + +RFC 5545 iCalendar September 2009 + + + with capitalized, quoted-strings of text. All calendar components + start with the letter "V". For example, "VEVENT" refers to the event + calendar component, "VTODO" refers to the to-do calendar component, + and "VJOURNAL" refers to the daily journal calendar component. + Scheduling methods defined by iTIP [2446bis] are referred to with + capitalized, quoted-strings of text. For example, "REQUEST" refers + to the method for requesting a scheduling calendar component be + created or modified, and "REPLY" refers to the method a recipient of + a request uses to update their status with the "Organizer" of the + calendar component. + + The properties defined by this memo are referred to with capitalized, + quoted-strings of text, followed by the word "property". For + example, "ATTENDEE" property refers to the iCalendar property used to + convey the calendar address of a calendar user. Property parameters + defined by this memo are referred to with lowercase, quoted-strings + of text, followed by the word "parameter". For example, "value" + parameter refers to the iCalendar property parameter used to override + the default value type for a property value. Enumerated values + defined by this memo are referred to with capitalized text, either + alone or followed by the word "value". For example, the "MINUTELY" + value can be used with the "FREQ" component of the "RECUR" value type + to specify repeating components based on an interval of one minute or + more. + + The following table lists the different characters from the + [US-ASCII] character set that is referenced in this document. For + each character, the table specifies the character name used + throughout this document, along with its US-ASCII decimal codepoint. + + + + + + + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 7] + +RFC 5545 iCalendar September 2009 + + + +------------------------+-------------------+ + | Character name | Decimal codepoint | + +------------------------+-------------------+ + | HTAB | 9 | + | LF | 10 | + | CR | 13 | + | DQUOTE | 22 | + | SPACE | 32 | + | PLUS SIGN | 43 | + | COMMA | 44 | + | HYPHEN-MINUS | 45 | + | PERIOD | 46 | + | SOLIDUS | 47 | + | COLON | 58 | + | SEMICOLON | 59 | + | LATIN CAPITAL LETTER N | 78 | + | LATIN CAPITAL LETTER T | 84 | + | LATIN CAPITAL LETTER X | 88 | + | LATIN CAPITAL LETTER Z | 90 | + | BACKSLASH | 92 | + | LATIN SMALL LETTER N | 110 | + +------------------------+-------------------+ + +2.2. Related Memos + + Implementers will need to be familiar with several other memos that, + along with this memo, form a framework for Internet calendaring and + scheduling standards. This memo specifies a core specification of + objects, value types, properties, and property parameters. + + o iTIP [2446bis] specifies an interoperability protocol for + scheduling between different implementations; + + o iCalendar Message-Based Interoperability Protocol (iMIP) [2447bis] + specifies an Internet email binding for [2446bis]. + + This memo does not attempt to repeat the specification of concepts or + definitions from these other memos. Where possible, references are + made to the memo that provides for the specification of these + concepts or definitions. + +3. iCalendar Object Specification + + The following sections define the details of a Calendaring and + Scheduling Core Object Specification. The Calendaring and Scheduling + Core Object is a collection of calendaring and scheduling + information. Typically, this information will consist of an + iCalendar stream with one or more iCalendar objects. The body of the + + + +Desruisseaux Standards Track [Page 8] + +RFC 5545 iCalendar September 2009 + + + iCalendar object consists of a sequence of calendar properties and + one or more calendar components. + + Section 3.1 defines the content line format; Section 3.2 defines the + property parameter format; Section 3.3 defines the data types for + property values; Section 3.4 defines the iCalendar object format; + Section 3.5 defines the iCalendar property format; Section 3.6 + defines the calendar component format; Section 3.7 defines calendar + properties; and Section 3.8 defines calendar component properties. + + This information is intended to be an integral part of the MIME + content type registration. In addition, this information can be used + independent of such content registration. In particular, this memo + has direct applicability for use as a calendaring and scheduling + exchange format in file-, memory-, or network-based transport + mechanisms. + +3.1. Content Lines + + The iCalendar object is organized into individual lines of text, + called content lines. Content lines are delimited by a line break, + which is a CRLF sequence (CR character followed by LF character). + + Lines of text SHOULD NOT be longer than 75 octets, excluding the line + break. Long content lines SHOULD be split into a multiple line + representations using a line "folding" technique. That is, a long + line can be split between any two characters by inserting a CRLF + immediately followed by a single linear white-space character (i.e., + SPACE or HTAB). Any sequence of CRLF followed immediately by a + single linear white-space character is ignored (i.e., removed) when + processing the content type. + + For example, the line: + + DESCRIPTION:This is a long description that exists on a long line. + + Can be represented as: + + DESCRIPTION:This is a lo + ng description + that exists on a long line. + + The process of moving from this folded multiple-line representation + to its single-line representation is called "unfolding". Unfolding + is accomplished by removing the CRLF and the linear white-space + character that immediately follows. + + + + + +Desruisseaux Standards Track [Page 9] + +RFC 5545 iCalendar September 2009 + + + When parsing a content line, folded lines MUST first be unfolded + according to the unfolding procedure described above. + + Note: It is possible for very simple implementations to generate + improperly folded lines in the middle of a UTF-8 multi-octet + sequence. For this reason, implementations need to unfold lines + in such a way to properly restore the original sequence. + + The content information associated with an iCalendar object is + formatted using a syntax similar to that defined by [RFC2425]. That + is, the content information consists of CRLF-separated content lines. + + The following notation defines the lines of content in an iCalendar + object: + + contentline = name *(";" param ) ":" value CRLF + ; This ABNF is just a general definition for an initial parsing + ; of the content line into its property name, parameter list, + ; and value string + + ; When parsing a content line, folded lines MUST first + ; be unfolded according to the unfolding procedure + ; described above. When generating a content line, lines + ; longer than 75 octets SHOULD be folded according to + ; the folding procedure described above. + + name = iana-token / x-name + + iana-token = 1*(ALPHA / DIGIT / "-") + ; iCalendar identifier registered with IANA + + x-name = "X-" [vendorid "-"] 1*(ALPHA / DIGIT / "-") + ; Reserved for experimental use. + + vendorid = 3*(ALPHA / DIGIT) + ; Vendor identification + + param = param-name "=" param-value *("," param-value) + ; Each property defines the specific ABNF for the parameters + ; allowed on the property. Refer to specific properties for + ; precise parameter ABNF. + + param-name = iana-token / x-name + + param-value = paramtext / quoted-string + + paramtext = *SAFE-CHAR + + + + +Desruisseaux Standards Track [Page 10] + +RFC 5545 iCalendar September 2009 + + + value = *VALUE-CHAR + + quoted-string = DQUOTE *QSAFE-CHAR DQUOTE + + QSAFE-CHAR = WSP / %x21 / %x23-7E / NON-US-ASCII + ; Any character except CONTROL and DQUOTE + + SAFE-CHAR = WSP / %x21 / %x23-2B / %x2D-39 / %x3C-7E + / NON-US-ASCII + ; Any character except CONTROL, DQUOTE, ";", ":", "," + + VALUE-CHAR = WSP / %x21-7E / NON-US-ASCII + ; Any textual character + + NON-US-ASCII = UTF8-2 / UTF8-3 / UTF8-4 + ; UTF8-2, UTF8-3, and UTF8-4 are defined in [RFC3629] + + CONTROL = %x00-08 / %x0A-1F / %x7F + ; All the controls except HTAB + + The property value component of a content line has a format that is + property specific. Refer to the section describing each property for + a definition of this format. + + All names of properties, property parameters, enumerated property + values and property parameter values are case-insensitive. However, + all other property values are case-sensitive, unless otherwise + stated. + +3.1.1. List and Field Separators + + Some properties and parameters allow a list of values. Values in a + list of values MUST be separated by a COMMA character. There is no + significance to the order of values in a list. For those parameter + values (such as those that specify URI values) that are specified in + quoted-strings, the individual quoted-strings are separated by a + COMMA character. + + Some property values are defined in terms of multiple parts. These + structured property values MUST have their value parts separated by a + SEMICOLON character. + + Some properties allow a list of parameters. Each property parameter + in a list of property parameters MUST be separated by a SEMICOLON + character. + + + + + + +Desruisseaux Standards Track [Page 11] + +RFC 5545 iCalendar September 2009 + + + Property parameters with values containing a COLON character, a + SEMICOLON character or a COMMA character MUST be placed in quoted + text. + + For example, in the following properties, a SEMICOLON is used to + separate property parameters from each other and a COMMA character is + used to separate property values in a value list. + + ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT:mailto: + jsmith@example.com + + RDATE;VALUE=DATE:19970304,19970504,19970704,19970904 + +3.1.2. Multiple Values + + Some properties defined in the iCalendar object can have multiple + values. The general rule for encoding multi-valued items is to + simply create a new content line for each value, including the + property name. However, it should be noted that some properties + support encoding multiple values in a single property by separating + the values with a COMMA character. Individual property definitions + should be consulted for determining whether a specific property + allows multiple values and in which of these two forms. Multi-valued + properties MUST NOT be used to specify multiple language variants of + the same value. Calendar applications SHOULD display all values. + +3.1.3. Binary Content + + Binary content information in an iCalendar object SHOULD be + referenced using a URI within a property value. That is, the binary + content information SHOULD be placed in an external MIME entity that + can be referenced by a URI from within the iCalendar object. In + applications where this is not feasible, binary content information + can be included within an iCalendar object, but only after first + encoding it into text using the "BASE64" encoding method defined in + [RFC4648]. Inline binary content SHOULD only be used in applications + whose special circumstances demand that an iCalendar object be + expressed as a single entity. A property containing inline binary + content information MUST specify the "ENCODING" property parameter. + Binary content information placed external to the iCalendar object + MUST be referenced by a uniform resource identifier (URI). + + The following example specifies an "ATTACH" property that references + an attachment external to the iCalendar object with a URI reference: + + ATTACH:http://example.com/public/quarterly-report.doc + + + + + +Desruisseaux Standards Track [Page 12] + +RFC 5545 iCalendar September 2009 + + + The following example specifies an "ATTACH" property with inline + binary encoded content information: + + ATTACH;FMTTYPE=text/plain;ENCODING=BASE64;VALUE=BINARY:VGhlIH + F1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4 + +3.1.4. Character Set + + There is not a property parameter to declare the charset used in a + property value. The default charset for an iCalendar stream is UTF-8 + as defined in [RFC3629]. + + The "charset" Content-Type parameter MUST be used in MIME transports + to specify the charset being used. + +3.2. Property Parameters + + A property can have attributes with which it is associated. These + "property parameters" contain meta-information about the property or + the property value. Property parameters are provided to specify such + information as the location of an alternate text representation for a + property value, the language of a text property value, the value type + of the property value, and other attributes. + + Property parameter values that contain the COLON, SEMICOLON, or COMMA + character separators MUST be specified as quoted-string text values. + Property parameter values MUST NOT contain the DQUOTE character. The + DQUOTE character is used as a delimiter for parameter values that + contain restricted characters or URI text. For example: + + DESCRIPTION;ALTREP="cid:part1.0001@example.org":The Fall'98 Wild + Wizards Conference - - Las Vegas\, NV\, USA + + Property parameter values that are not in quoted-strings are case- + insensitive. + + The general property parameters defined by this memo are defined by + the following notation: + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 13] + +RFC 5545 iCalendar September 2009 + + + icalparameter = altrepparam ; Alternate text representation + / cnparam ; Common name + / cutypeparam ; Calendar user type + / delfromparam ; Delegator + / deltoparam ; Delegatee + / dirparam ; Directory entry + / encodingparam ; Inline encoding + / fmttypeparam ; Format type + / fbtypeparam ; Free/busy time type + / languageparam ; Language for text + / memberparam ; Group or list membership + / partstatparam ; Participation status + / rangeparam ; Recurrence identifier range + / trigrelparam ; Alarm trigger relationship + / reltypeparam ; Relationship type + / roleparam ; Participation role + / rsvpparam ; RSVP expectation + / sentbyparam ; Sent by + / tzidparam ; Reference to time zone object + / valuetypeparam ; Property value data type + / other-param + + other-param = (iana-param / x-param) + + iana-param = iana-token "=" param-value *("," param-value) + ; Some other IANA-registered iCalendar parameter. + + x-param = x-name "=" param-value *("," param-value) + ; A non-standard, experimental parameter. + + Applications MUST ignore x-param and iana-param values they don't + recognize. + +3.2.1. Alternate Text Representation + + Parameter Name: ALTREP + + Purpose: To specify an alternate text representation for the + property value. + + Format Definition: This property parameter is defined by the + following notation: + + altrepparam = "ALTREP" "=" DQUOTE uri DQUOTE + + Description: This parameter specifies a URI that points to an + alternate representation for a textual property value. A property + specifying this parameter MUST also include a value that reflects + + + +Desruisseaux Standards Track [Page 14] + +RFC 5545 iCalendar September 2009 + + + the default representation of the text value. The URI parameter + value MUST be specified in a quoted-string. + + Note: While there is no restriction imposed on the URI schemes + allowed for this parameter, Content Identifier (CID) [RFC2392], + HTTP [RFC2616], and HTTPS [RFC2818] are the URI schemes most + commonly used by current implementations. + + Example: + + DESCRIPTION;ALTREP="CID:part3.msg.970415T083000@example.com": + Project XYZ Review Meeting will include the following agenda + items: (a) Market Overview\, (b) Finances\, (c) Project Man + agement + + The "ALTREP" property parameter value might point to a "text/html" + content portion. + + Content-Type:text/html + Content-Id: + + + + + + +

+ Project XYZ Review Meeting will include + the following agenda items: +

    +
  1. Market Overview
  2. +
  3. Finances
  4. +
  5. Project Management
  6. +
+

+ + + +3.2.2. Common Name + + Parameter Name: CN + + Purpose: To specify the common name to be associated with the + calendar user specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + + + +Desruisseaux Standards Track [Page 15] + +RFC 5545 iCalendar September 2009 + + + cnparam = "CN" "=" param-value + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter specifies the common name + to be associated with the calendar user specified by the property. + The parameter value is text. The parameter value can be used for + display text to be associated with the calendar address specified + by the property. + + Example: + + ORGANIZER;CN="John Smith":mailto:jsmith@example.com + +3.2.3. Calendar User Type + + Parameter Name: CUTYPE + + Purpose: To identify the type of calendar user specified by the + property. + + Format Definition: This property parameter is defined by the + following notation: + + cutypeparam = "CUTYPE" "=" + ("INDIVIDUAL" ; An individual + / "GROUP" ; A group of individuals + / "RESOURCE" ; A physical resource + / "ROOM" ; A room resource + / "UNKNOWN" ; Otherwise not known + / x-name ; Experimental type + / iana-token) ; Other IANA-registered + ; type + ; Default is INDIVIDUAL + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter identifies the type of + calendar user specified by the property. If not specified on a + property that allows this parameter, the default is INDIVIDUAL. + Applications MUST treat x-name and iana-token values they don't + recognize the same way as they would the UNKNOWN value. + + Example: + + ATTENDEE;CUTYPE=GROUP:mailto:ietf-calsch@example.org + + + + + + + +Desruisseaux Standards Track [Page 16] + +RFC 5545 iCalendar September 2009 + + +3.2.4. Delegators + + Parameter Name: DELEGATED-FROM + + Purpose: To specify the calendar users that have delegated their + participation to the calendar user specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + delfromparam = "DELEGATED-FROM" "=" DQUOTE cal-address + DQUOTE *("," DQUOTE cal-address DQUOTE) + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. This parameter specifies those calendar + users that have delegated their participation in a group-scheduled + event or to-do to the calendar user specified by the property. + The individual calendar address parameter values MUST each be + specified in a quoted-string. + + Example: + + ATTENDEE;DELEGATED-FROM="mailto:jsmith@example.com":mailto: + jdoe@example.com + +3.2.5. Delegatees + + Parameter Name: DELEGATED-TO + + Purpose: To specify the calendar users to whom the calendar user + specified by the property has delegated participation. + + Format Definition: This property parameter is defined by the + following notation: + + deltoparam = "DELEGATED-TO" "=" DQUOTE cal-address DQUOTE + *("," DQUOTE cal-address DQUOTE) + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. This parameter specifies those calendar + users whom have been delegated participation in a group-scheduled + event or to-do by the calendar user specified by the property. + The individual calendar address parameter values MUST each be + specified in a quoted-string. + + + + + + + +Desruisseaux Standards Track [Page 17] + +RFC 5545 iCalendar September 2009 + + + Example: + + ATTENDEE;DELEGATED-TO="mailto:jdoe@example.com","mailto:jqpublic + @example.com":mailto:jsmith@example.com + +3.2.6. Directory Entry Reference + + Parameter Name: DIR + + Purpose: To specify reference to a directory entry associated with + the calendar user specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + dirparam = "DIR" "=" DQUOTE uri DQUOTE + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter specifies a reference to + the directory entry associated with the calendar user specified by + the property. The parameter value is a URI. The URI parameter + value MUST be specified in a quoted-string. + + Note: While there is no restriction imposed on the URI schemes + allowed for this parameter, CID [RFC2392], DATA [RFC2397], FILE + [RFC1738], FTP [RFC1738], HTTP [RFC2616], HTTPS [RFC2818], LDAP + [RFC4516], and MID [RFC2392] are the URI schemes most commonly + used by current implementations. + + Example: + + ORGANIZER;DIR="ldap://example.com:6666/o=ABC%20Industries, + c=US???(cn=Jim%20Dolittle)":mailto:jimdo@example.com + +3.2.7. Inline Encoding + + Parameter Name: ENCODING + + Purpose: To specify an alternate inline encoding for the property + value. + + Format Definition: This property parameter is defined by the + following notation: + + + + + + + + +Desruisseaux Standards Track [Page 18] + +RFC 5545 iCalendar September 2009 + + + encodingparam = "ENCODING" "=" + ( "8BIT" + ; "8bit" text encoding is defined in [RFC2045] + / "BASE64" + ; "BASE64" binary encoding format is defined in [RFC4648] + ) + + Description: This property parameter identifies the inline encoding + used in a property value. The default encoding is "8BIT", + corresponding to a property value consisting of text. The + "BASE64" encoding type corresponds to a property value encoded + using the "BASE64" encoding defined in [RFC2045]. + + If the value type parameter is ";VALUE=BINARY", then the inline + encoding parameter MUST be specified with the value + ";ENCODING=BASE64". + + Example: + + ATTACH;FMTTYPE=text/plain;ENCODING=BASE64;VALUE=BINARY:TG9yZW + 0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2ljaW + 5nIGVsaXQsIHNlZCBkbyBlaXVzbW9kIHRlbXBvciBpbmNpZGlkdW50IHV0IG + xhYm9yZSBldCBkb2xvcmUgbWFnbmEgYWxpcXVhLiBVdCBlbmltIGFkIG1pbm + ltIHZlbmlhbSwgcXVpcyBub3N0cnVkIGV4ZXJjaXRhdGlvbiB1bGxhbWNvIG + xhYm9yaXMgbmlzaSB1dCBhbGlxdWlwIGV4IGVhIGNvbW1vZG8gY29uc2VxdW + F0LiBEdWlzIGF1dGUgaXJ1cmUgZG9sb3IgaW4gcmVwcmVoZW5kZXJpdCBpbi + B2b2x1cHRhdGUgdmVsaXQgZXNzZSBjaWxsdW0gZG9sb3JlIGV1IGZ1Z2lhdC + BudWxsYSBwYXJpYXR1ci4gRXhjZXB0ZXVyIHNpbnQgb2NjYWVjYXQgY3VwaW + RhdGF0IG5vbiBwcm9pZGVudCwgc3VudCBpbiBjdWxwYSBxdWkgb2ZmaWNpYS + BkZXNlcnVudCBtb2xsaXQgYW5pbSBpZCBlc3QgbGFib3J1bS4= + +3.2.8. Format Type + + Parameter Name: FMTTYPE + + Purpose: To specify the content type of a referenced object. + + Format Definition: This property parameter is defined by the + following notation: + + fmttypeparam = "FMTTYPE" "=" type-name "/" subtype-name + ; Where "type-name" and "subtype-name" are + ; defined in Section 4.2 of [RFC4288]. + + Description: This parameter can be specified on properties that are + used to reference an object. The parameter specifies the media + type [RFC4288] of the referenced object. For example, on the + "ATTACH" property, an FTP type URI value does not, by itself, + + + +Desruisseaux Standards Track [Page 19] + +RFC 5545 iCalendar September 2009 + + + necessarily convey the type of content associated with the + resource. The parameter value MUST be the text for either an + IANA-registered media type or a non-standard media type. + + Example: + + ATTACH;FMTTYPE=application/msword:ftp://example.com/pub/docs/ + agenda.doc + +3.2.9. Free/Busy Time Type + + Parameter Name: FBTYPE + + Purpose: To specify the free or busy time type. + + Format Definition: This property parameter is defined by the + following notation: + + fbtypeparam = "FBTYPE" "=" ("FREE" / "BUSY" + / "BUSY-UNAVAILABLE" / "BUSY-TENTATIVE" + / x-name + ; Some experimental iCalendar free/busy type. + / iana-token) + ; Some other IANA-registered iCalendar free/busy type. + + Description: This parameter specifies the free or busy time type. + The value FREE indicates that the time interval is free for + scheduling. The value BUSY indicates that the time interval is + busy because one or more events have been scheduled for that + interval. The value BUSY-UNAVAILABLE indicates that the time + interval is busy and that the interval can not be scheduled. The + value BUSY-TENTATIVE indicates that the time interval is busy + because one or more events have been tentatively scheduled for + that interval. If not specified on a property that allows this + parameter, the default is BUSY. Applications MUST treat x-name + and iana-token values they don't recognize the same way as they + would the BUSY value. + + Example: The following is an example of this parameter on a + "FREEBUSY" property. + + FREEBUSY;FBTYPE=BUSY:19980415T133000Z/19980415T170000Z + + + + + + + + + +Desruisseaux Standards Track [Page 20] + +RFC 5545 iCalendar September 2009 + + +3.2.10. Language + + Parameter Name: LANGUAGE + + Purpose: To specify the language for text values in a property or + property parameter. + + Format Definition: This property parameter is defined by the + following notation: + + languageparam = "LANGUAGE" "=" language + + language = Language-Tag + ; As defined in [RFC5646]. + + Description: This parameter identifies the language of the text in + the property value and of all property parameter values of the + property. The value of the "LANGUAGE" property parameter is that + defined in [RFC5646]. + + For transport in a MIME entity, the Content-Language header field + can be used to set the default language for the entire body part. + Otherwise, no default language is assumed. + + Example: The following are examples of this parameter on the + "SUMMARY" and "LOCATION" properties: + + SUMMARY;LANGUAGE=en-US:Company Holiday Party + + LOCATION;LANGUAGE=en:Germany + + LOCATION;LANGUAGE=no:Tyskland + +3.2.11. Group or List Membership + + Parameter Name: MEMBER + + Purpose: To specify the group or list membership of the calendar + user specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + memberparam = "MEMBER" "=" DQUOTE cal-address DQUOTE + *("," DQUOTE cal-address DQUOTE) + + + + + + +Desruisseaux Standards Track [Page 21] + +RFC 5545 iCalendar September 2009 + + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter identifies the groups or + list membership for the calendar user specified by the property. + The parameter value is either a single calendar address in a + quoted-string or a COMMA-separated list of calendar addresses, + each in a quoted-string. The individual calendar address + parameter values MUST each be specified in a quoted-string. + + Example: + + ATTENDEE;MEMBER="mailto:ietf-calsch@example.org":mailto: + jsmith@example.com + + ATTENDEE;MEMBER="mailto:projectA@example.com","mailto:pr + ojectB@example.com":mailto:janedoe@example.com + +3.2.12. Participation Status + + Parameter Name: PARTSTAT + + Purpose: To specify the participation status for the calendar user + specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + partstatparam = "PARTSTAT" "=" + (partstat-event + / partstat-todo + / partstat-jour) + + partstat-event = ("NEEDS-ACTION" ; Event needs action + / "ACCEPTED" ; Event accepted + / "DECLINED" ; Event declined + / "TENTATIVE" ; Event tentatively + ; accepted + / "DELEGATED" ; Event delegated + / x-name ; Experimental status + / iana-token) ; Other IANA-registered + ; status + ; These are the participation statuses for a "VEVENT". + ; Default is NEEDS-ACTION. + + partstat-todo = ("NEEDS-ACTION" ; To-do needs action + / "ACCEPTED" ; To-do accepted + / "DECLINED" ; To-do declined + / "TENTATIVE" ; To-do tentatively + ; accepted + + + +Desruisseaux Standards Track [Page 22] + +RFC 5545 iCalendar September 2009 + + + / "DELEGATED" ; To-do delegated + / "COMPLETED" ; To-do completed + ; COMPLETED property has + ; DATE-TIME completed + / "IN-PROCESS" ; To-do in process of + ; being completed + / x-name ; Experimental status + / iana-token) ; Other IANA-registered + ; status + ; These are the participation statuses for a "VTODO". + ; Default is NEEDS-ACTION. + + + + partstat-jour = ("NEEDS-ACTION" ; Journal needs action + / "ACCEPTED" ; Journal accepted + / "DECLINED" ; Journal declined + / x-name ; Experimental status + / iana-token) ; Other IANA-registered + ; status + ; These are the participation statuses for a "VJOURNAL". + ; Default is NEEDS-ACTION. + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter identifies the + participation status for the calendar user specified by the + property value. The parameter values differ depending on whether + they are associated with a group-scheduled "VEVENT", "VTODO", or + "VJOURNAL". The values MUST match one of the values allowed for + the given calendar component. If not specified on a property that + allows this parameter, the default value is NEEDS-ACTION. + Applications MUST treat x-name and iana-token values they don't + recognize the same way as they would the NEEDS-ACTION value. + + Example: + + ATTENDEE;PARTSTAT=DECLINED:mailto:jsmith@example.com + +3.2.13. Recurrence Identifier Range + + Parameter Name: RANGE + + Purpose: To specify the effective range of recurrence instances from + the instance specified by the recurrence identifier specified by + the property. + + Format Definition: This property parameter is defined by the + following notation: + + + +Desruisseaux Standards Track [Page 23] + +RFC 5545 iCalendar September 2009 + + + rangeparam = "RANGE" "=" "THISANDFUTURE" + ; To specify the instance specified by the recurrence identifier + ; and all subsequent recurrence instances. + + Description: This parameter can be specified on a property that + specifies a recurrence identifier. The parameter specifies the + effective range of recurrence instances that is specified by the + property. The effective range is from the recurrence identifier + specified by the property. If this parameter is not specified on + an allowed property, then the default range is the single instance + specified by the recurrence identifier value of the property. The + parameter value can only be "THISANDFUTURE" to indicate a range + defined by the recurrence identifier and all subsequent instances. + The value "THISANDPRIOR" is deprecated by this revision of + iCalendar and MUST NOT be generated by applications. + + Example: + + RECURRENCE-ID;RANGE=THISANDFUTURE:19980401T133000Z + +3.2.14. Alarm Trigger Relationship + + Parameter Name: RELATED + + Purpose: To specify the relationship of the alarm trigger with + respect to the start or end of the calendar component. + + Format Definition: This property parameter is defined by the + following notation: + + trigrelparam = "RELATED" "=" + ("START" ; Trigger off of start + / "END") ; Trigger off of end + + Description: This parameter can be specified on properties that + specify an alarm trigger with a "DURATION" value type. The + parameter specifies whether the alarm will trigger relative to the + start or end of the calendar component. The parameter value START + will set the alarm to trigger off the start of the calendar + component; the parameter value END will set the alarm to trigger + off the end of the calendar component. If the parameter is not + specified on an allowable property, then the default is START. + + Example: + + TRIGGER;RELATED=END:PT5M + + + + + +Desruisseaux Standards Track [Page 24] + +RFC 5545 iCalendar September 2009 + + +3.2.15. Relationship Type + + Parameter Name: RELTYPE + + Purpose: To specify the type of hierarchical relationship associated + with the calendar component specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + reltypeparam = "RELTYPE" "=" + ("PARENT" ; Parent relationship - Default + / "CHILD" ; Child relationship + / "SIBLING" ; Sibling relationship + / iana-token ; Some other IANA-registered + ; iCalendar relationship type + / x-name) ; A non-standard, experimental + ; relationship type + + Description: This parameter can be specified on a property that + references another related calendar. The parameter specifies the + hierarchical relationship type of the calendar component + referenced by the property. The parameter value can be PARENT, to + indicate that the referenced calendar component is a superior of + calendar component; CHILD to indicate that the referenced calendar + component is a subordinate of the calendar component; or SIBLING + to indicate that the referenced calendar component is a peer of + the calendar component. If this parameter is not specified on an + allowable property, the default relationship type is PARENT. + Applications MUST treat x-name and iana-token values they don't + recognize the same way as they would the PARENT value. + + Example: + + RELATED-TO;RELTYPE=SIBLING:19960401-080045-4000F192713@ + example.com + +3.2.16. Participation Role + + Parameter Name: ROLE + + Purpose: To specify the participation role for the calendar user + specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + + + + +Desruisseaux Standards Track [Page 25] + +RFC 5545 iCalendar September 2009 + + + roleparam = "ROLE" "=" + ("CHAIR" ; Indicates chair of the + ; calendar entity + / "REQ-PARTICIPANT" ; Indicates a participant whose + ; participation is required + / "OPT-PARTICIPANT" ; Indicates a participant whose + ; participation is optional + / "NON-PARTICIPANT" ; Indicates a participant who + ; is copied for information + ; purposes only + / x-name ; Experimental role + / iana-token) ; Other IANA role + ; Default is REQ-PARTICIPANT + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter specifies the participation + role for the calendar user specified by the property in the group + schedule calendar component. If not specified on a property that + allows this parameter, the default value is REQ-PARTICIPANT. + Applications MUST treat x-name and iana-token values they don't + recognize the same way as they would the REQ-PARTICIPANT value. + + Example: + + ATTENDEE;ROLE=CHAIR:mailto:mrbig@example.com + +3.2.17. RSVP Expectation + + Parameter Name: RSVP + + Purpose: To specify whether there is an expectation of a favor of a + reply from the calendar user specified by the property value. + + Format Definition: This property parameter is defined by the + following notation: + + rsvpparam = "RSVP" "=" ("TRUE" / "FALSE") + ; Default is FALSE + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter identifies the expectation + of a reply from the calendar user specified by the property value. + This parameter is used by the "Organizer" to request a + participation status reply from an "Attendee" of a group-scheduled + event or to-do. If not specified on a property that allows this + parameter, the default value is FALSE. + + + + + +Desruisseaux Standards Track [Page 26] + +RFC 5545 iCalendar September 2009 + + + Example: + + ATTENDEE;RSVP=TRUE:mailto:jsmith@example.com + +3.2.18. Sent By + + Parameter Name: SENT-BY + + Purpose: To specify the calendar user that is acting on behalf of + the calendar user specified by the property. + + Format Definition: This property parameter is defined by the + following notation: + + sentbyparam = "SENT-BY" "=" DQUOTE cal-address DQUOTE + + Description: This parameter can be specified on properties with a + CAL-ADDRESS value type. The parameter specifies the calendar user + that is acting on behalf of the calendar user specified by the + property. The parameter value MUST be a mailto URI as defined in + [RFC2368]. The individual calendar address parameter values MUST + each be specified in a quoted-string. + + Example: + + ORGANIZER;SENT-BY="mailto:sray@example.com":mailto: + jsmith@example.com + +3.2.19. Time Zone Identifier + + Parameter Name: TZID + + Purpose: To specify the identifier for the time zone definition for + a time component in the property value. + + Format Definition: This property parameter is defined by the + following notation: + + tzidparam = "TZID" "=" [tzidprefix] paramtext + + tzidprefix = "/" + + Description: This parameter MUST be specified on the "DTSTART", + "DTEND", "DUE", "EXDATE", and "RDATE" properties when either a + DATE-TIME or TIME value type is specified and when the value is + neither a UTC or a "floating" time. Refer to the DATE-TIME or + TIME value type definition for a description of UTC and "floating + time" formats. This property parameter specifies a text value + + + +Desruisseaux Standards Track [Page 27] + +RFC 5545 iCalendar September 2009 + + + that uniquely identifies the "VTIMEZONE" calendar component to be + used when evaluating the time portion of the property. The value + of the "TZID" property parameter will be equal to the value of the + "TZID" property for the matching time zone definition. An + individual "VTIMEZONE" calendar component MUST be specified for + each unique "TZID" parameter value specified in the iCalendar + object. + + The parameter MUST be specified on properties with a DATE-TIME + value if the DATE-TIME is not either a UTC or a "floating" time. + Failure to include and follow VTIMEZONE definitions in iCalendar + objects may lead to inconsistent understanding of the local time + at any given location. + + The presence of the SOLIDUS character as a prefix, indicates that + this "TZID" represents a unique ID in a globally defined time zone + registry (when such registry is defined). + + Note: This document does not define a naming convention for + time zone identifiers. Implementers may want to use the naming + conventions defined in existing time zone specifications such + as the public-domain TZ database [TZDB]. The specification of + globally unique time zone identifiers is not addressed by this + document and is left for future study. + + The following are examples of this property parameter: + + DTSTART;TZID=America/New_York:19980119T020000 + + DTEND;TZID=America/New_York:19980119T030000 + + The "TZID" property parameter MUST NOT be applied to DATE + properties and DATE-TIME or TIME properties whose time values are + specified in UTC. + + The use of local time in a DATE-TIME or TIME value without the + "TZID" property parameter is to be interpreted as floating time, + regardless of the existence of "VTIMEZONE" calendar components in + the iCalendar object. + + For more information, see the sections on the value types DATE- + TIME and TIME. + + + + + + + + + +Desruisseaux Standards Track [Page 28] + +RFC 5545 iCalendar September 2009 + + +3.2.20. Value Data Types + + Parameter Name: VALUE + + Purpose: To explicitly specify the value type format for a property + value. + + Format Definition: This property parameter is defined by the + following notation: + + valuetypeparam = "VALUE" "=" valuetype + + valuetype = ("BINARY" + / "BOOLEAN" + / "CAL-ADDRESS" + / "DATE" + / "DATE-TIME" + / "DURATION" + / "FLOAT" + / "INTEGER" + / "PERIOD" + / "RECUR" + / "TEXT" + / "TIME" + / "URI" + / "UTC-OFFSET" + / x-name + ; Some experimental iCalendar value type. + / iana-token) + ; Some other IANA-registered iCalendar value type. + + Description: This parameter specifies the value type and format of + the property value. The property values MUST be of a single value + type. For example, a "RDATE" property cannot have a combination + of DATE-TIME and TIME value types. + + If the property's value is the default value type, then this + parameter need not be specified. However, if the property's + default value type is overridden by some other allowable value + type, then this parameter MUST be specified. + + Applications MUST preserve the value data for x-name and iana- + token values that they don't recognize without attempting to + interpret or parse the value data. + + + + + + + +Desruisseaux Standards Track [Page 29] + +RFC 5545 iCalendar September 2009 + + +3.3. Property Value Data Types + + The properties in an iCalendar object are strongly typed. The + definition of each property restricts the value to be one of the + value data types, or simply value types, defined in this section. + The value type for a property will either be specified implicitly as + the default value type or will be explicitly specified with the + "VALUE" parameter. If the value type of a property is one of the + alternate valid types, then it MUST be explicitly specified with the + "VALUE" parameter. + +3.3.1. Binary + + Value Name: BINARY + + Purpose: This value type is used to identify properties that contain + a character encoding of inline binary data. For example, an + inline attachment of a document might be included in an iCalendar + object. + + Format Definition: This value type is defined by the following + notation: + + binary = *(4b-char) [b-end] + ; A "BASE64" encoded character string, as defined by [RFC4648]. + + b-end = (2b-char "==") / (3b-char "=") + + b-char = ALPHA / DIGIT / "+" / "/" + + Description: Property values with this value type MUST also include + the inline encoding parameter sequence of ";ENCODING=BASE64". + That is, all inline binary data MUST first be character encoded + using the "BASE64" encoding method defined in [RFC2045]. No + additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 30] + +RFC 5545 iCalendar September 2009 + + + Example: The following is an example of a "BASE64" encoded binary + value data: + + ATTACH;FMTTYPE=image/vnd.microsoft.icon;ENCODING=BASE64;VALUE + =BINARY:AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgIAAAICAgADAwMAA////AAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAMwAAAAAAABNEMQAAAAAAAkQgAAAAAAJEREQgAA + ACECQ0QgEgAAQxQzM0E0AABERCRCREQAADRDJEJEQwAAAhA0QwEQAAAAAERE + AAAAAAAAREQAAAAAAAAkQgAAAAAAAAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAA + +3.3.2. Boolean + + Value Name: BOOLEAN + + Purpose: This value type is used to identify properties that contain + either a "TRUE" or "FALSE" Boolean value. + + Format Definition: This value type is defined by the following + notation: + + boolean = "TRUE" / "FALSE" + + Description: These values are case-insensitive text. No additional + content value encoding (i.e., BACKSLASH character encoding, see + Section 3.3.11) is defined for this value type. + + Example: The following is an example of a hypothetical property that + has a BOOLEAN value type: + + TRUE + +3.3.3. Calendar User Address + + Value Name: CAL-ADDRESS + + Purpose: This value type is used to identify properties that contain + a calendar user address. + + Format Definition: This value type is defined by the following + notation: + + cal-address = uri + + Description: The value is a URI as defined by [RFC3986] or any other + IANA-registered form for a URI. When used to address an Internet + + + +Desruisseaux Standards Track [Page 31] + +RFC 5545 iCalendar September 2009 + + + email transport address for a calendar user, the value MUST be a + mailto URI, as defined by [RFC2368]. No additional content value + encoding (i.e., BACKSLASH character encoding, see Section 3.3.11) + is defined for this value type. + + Example: + + mailto:jane_doe@example.com + +3.3.4. Date + + Value Name: DATE + + Purpose: This value type is used to identify values that contain a + calendar date. + + Format Definition: This value type is defined by the following + notation: + + date = date-value + + date-value = date-fullyear date-month date-mday + date-fullyear = 4DIGIT + date-month = 2DIGIT ;01-12 + date-mday = 2DIGIT ;01-28, 01-29, 01-30, 01-31 + ;based on month/year + + Description: If the property permits, multiple "date" values are + specified as a COMMA-separated list of values. The format for the + value type is based on the [ISO.8601.2004] complete + representation, basic format for a calendar date. The textual + format specifies a four-digit year, two-digit month, and two-digit + day of the month. There are no separator characters between the + year, month, and day component text. + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + Example: The following represents July 14, 1997: + + 19970714 + +3.3.5. Date-Time + + Value Name: DATE-TIME + + Purpose: This value type is used to identify values that specify a + precise calendar date and time of day. + + + +Desruisseaux Standards Track [Page 32] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This value type is defined by the following + notation: + + date-time = date "T" time ;As specified in the DATE and TIME + ;value definitions + + Description: If the property permits, multiple "DATE-TIME" values + are specified as a COMMA-separated list of values. No additional + content value encoding (i.e., BACKSLASH character encoding, see + Section 3.3.11) is defined for this value type. + + The "DATE-TIME" value type is used to identify values that contain + a precise calendar date and time of day. The format is based on + the [ISO.8601.2004] complete representation, basic format for a + calendar date and time of day. The text format is a concatenation + of the "date", followed by the LATIN CAPITAL LETTER T character, + the time designator, followed by the "time" format. + + The "DATE-TIME" value type expresses time values in three forms: + + The form of date and time with UTC offset MUST NOT be used. For + example, the following is not valid for a DATE-TIME value: + + 19980119T230000-0800 ;Invalid time format + + FORM #1: DATE WITH LOCAL TIME + + The date with local time form is simply a DATE-TIME value that + does not contain the UTC designator nor does it reference a time + zone. For example, the following represents January 18, 1998, at + 11 PM: + + 19980118T230000 + + DATE-TIME values of this type are said to be "floating" and are + not bound to any time zone in particular. They are used to + represent the same hour, minute, and second value regardless of + which time zone is currently being observed. For example, an + event can be defined that indicates that an individual will be + busy from 11:00 AM to 1:00 PM every day, no matter which time zone + the person is in. In these cases, a local time can be specified. + The recipient of an iCalendar object with a property value + consisting of a local time, without any relative time zone + information, SHOULD interpret the value as being fixed to whatever + time zone the "ATTENDEE" is in at any given moment. This means + that two "Attendees", in different time zones, receiving the same + event definition as a floating time, may be participating in the + + + + +Desruisseaux Standards Track [Page 33] + +RFC 5545 iCalendar September 2009 + + + event at different actual times. Floating time SHOULD only be + used where that is the reasonable behavior. + + In most cases, a fixed time is desired. To properly communicate a + fixed time in a property value, either UTC time or local time with + time zone reference MUST be specified. + + The use of local time in a DATE-TIME value without the "TZID" + property parameter is to be interpreted as floating time, + regardless of the existence of "VTIMEZONE" calendar components in + the iCalendar object. + + FORM #2: DATE WITH UTC TIME + + The date with UTC time, or absolute time, is identified by a LATIN + CAPITAL LETTER Z suffix character, the UTC designator, appended to + the time value. For example, the following represents January 19, + 1998, at 0700 UTC: + + 19980119T070000Z + + The "TZID" property parameter MUST NOT be applied to DATE-TIME + properties whose time values are specified in UTC. + + FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE + + The date and local time with reference to time zone information is + identified by the use the "TZID" property parameter to reference + the appropriate time zone definition. "TZID" is discussed in + detail in Section 3.2.19. For example, the following represents + 2:00 A.M. in New York on January 19, 1998: + + TZID=America/New_York:19980119T020000 + + If, based on the definition of the referenced time zone, the local + time described occurs more than once (when changing from daylight + to standard time), the DATE-TIME value refers to the first + occurrence of the referenced time. Thus, TZID=America/ + New_York:20071104T013000 indicates November 4, 2007 at 1:30 A.M. + EDT (UTC-04:00). If the local time described does not occur (when + changing from standard to daylight time), the DATE-TIME value is + interpreted using the UTC offset before the gap in local times. + Thus, TZID=America/New_York:20070311T023000 indicates March 11, + 2007 at 3:30 A.M. EDT (UTC-04:00), one hour after 1:30 A.M. EST + (UTC-05:00). + + + + + + +Desruisseaux Standards Track [Page 34] + +RFC 5545 iCalendar September 2009 + + + A time value MUST only specify the second 60 when specifying a + positive leap second. For example: + + 19970630T235960Z + + Implementations that do not support leap seconds SHOULD interpret + the second 60 as equivalent to the second 59. + + Example: The following represents July 14, 1997, at 1:30 PM in New + York City in each of the three time formats, using the "DTSTART" + property. + + DTSTART:19970714T133000 ; Local time + DTSTART:19970714T173000Z ; UTC time + DTSTART;TZID=America/New_York:19970714T133000 + ; Local time and time + ; zone reference + +3.3.6. Duration + + Value Name: DURATION + + Purpose: This value type is used to identify properties that contain + a duration of time. + + Format Definition: This value type is defined by the following + notation: + + dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week) + + dur-date = dur-day [dur-time] + dur-time = "T" (dur-hour / dur-minute / dur-second) + dur-week = 1*DIGIT "W" + dur-hour = 1*DIGIT "H" [dur-minute] + dur-minute = 1*DIGIT "M" [dur-second] + dur-second = 1*DIGIT "S" + dur-day = 1*DIGIT "D" + + Description: If the property permits, multiple "duration" values are + specified by a COMMA-separated list of values. The format is + based on the [ISO.8601.2004] complete representation basic format + with designators for the duration of time. The format can + represent nominal durations (weeks and days) and accurate + durations (hours, minutes, and seconds). Note that unlike + [ISO.8601.2004], this value type doesn't support the "Y" and "M" + designators to specify durations in terms of years and months. + + + + + +Desruisseaux Standards Track [Page 35] + +RFC 5545 iCalendar September 2009 + + + The duration of a week or a day depends on its position in the + calendar. In the case of discontinuities in the time scale, such + as the change from standard time to daylight time and back, the + computation of the exact duration requires the subtraction or + addition of the change of duration of the discontinuity. Leap + seconds MUST NOT be considered when computing an exact duration. + When computing an exact duration, the greatest order time + components MUST be added first, that is, the number of days MUST + be added first, followed by the number of hours, number of + minutes, and number of seconds. + + Negative durations are typically used to schedule an alarm to + trigger before an associated time (see Section 3.8.6.3). + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) are defined for this value type. + + Example: A duration of 15 days, 5 hours, and 20 seconds would be: + + P15DT5H0M20S + + A duration of 7 weeks would be: + + P7W + +3.3.7. Float + + Value Name: FLOAT + + Purpose: This value type is used to identify properties that contain + a real-number value. + + Format Definition: This value type is defined by the following + notation: + + float = (["+"] / "-") 1*DIGIT ["." 1*DIGIT] + + Description: If the property permits, multiple "float" values are + specified by a COMMA-separated list of values. + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + Example: + + 1000000.0000001 + 1.333 + -3.14 + + + +Desruisseaux Standards Track [Page 36] + +RFC 5545 iCalendar September 2009 + + +3.3.8. Integer + + Value Name: INTEGER + + Purpose: This value type is used to identify properties that contain + a signed integer value. + + Format Definition: This value type is defined by the following + notation: + + integer = (["+"] / "-") 1*DIGIT + + Description: If the property permits, multiple "integer" values are + specified by a COMMA-separated list of values. The valid range + for "integer" is -2147483648 to 2147483647. If the sign is not + specified, then the value is assumed to be positive. + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + Example: + + 1234567890 + -1234567890 + +1234567890 + 432109876 + +3.3.9. Period of Time + + Value Name: PERIOD + + Purpose: This value type is used to identify values that contain a + precise period of time. + + Format Definition: This value type is defined by the following + notation: + + period = period-explicit / period-start + + period-explicit = date-time "/" date-time + ; [ISO.8601.2004] complete representation basic format for a + ; period of time consisting of a start and end. The start MUST + ; be before the end. + + period-start = date-time "/" dur-value + ; [ISO.8601.2004] complete representation basic format for a + ; period of time consisting of a start and positive duration + ; of time. + + + +Desruisseaux Standards Track [Page 37] + +RFC 5545 iCalendar September 2009 + + + Description: If the property permits, multiple "period" values are + specified by a COMMA-separated list of values. There are two + forms of a period of time. First, a period of time is identified + by its start and its end. This format is based on the + [ISO.8601.2004] complete representation, basic format for "DATE- + TIME" start of the period, followed by a SOLIDUS character + followed by the "DATE-TIME" of the end of the period. The start + of the period MUST be before the end of the period. Second, a + period of time can also be defined by a start and a positive + duration of time. The format is based on the [ISO.8601.2004] + complete representation, basic format for the "DATE-TIME" start of + the period, followed by a SOLIDUS character, followed by the + [ISO.8601.2004] basic format for "DURATION" of the period. + + Example: The period starting at 18:00:00 UTC, on January 1, 1997 and + ending at 07:00:00 UTC on January 2, 1997 would be: + + 19970101T180000Z/19970102T070000Z + + The period start at 18:00:00 on January 1, 1997 and lasting 5 + hours and 30 minutes would be: + + 19970101T180000Z/PT5H30M + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + +3.3.10. Recurrence Rule + + Value Name: RECUR + + Purpose: This value type is used to identify properties that contain + a recurrence rule specification. + + Format Definition: This value type is defined by the following + notation: + + recur = recur-rule-part *( ";" recur-rule-part ) + ; + ; The rule parts are not ordered in any + ; particular sequence. + ; + ; The FREQ rule part is REQUIRED, + ; but MUST NOT occur more than once. + ; + ; The UNTIL or COUNT rule parts are OPTIONAL, + ; but they MUST NOT occur in the same 'recur'. + ; + + + +Desruisseaux Standards Track [Page 38] + +RFC 5545 iCalendar September 2009 + + + ; The other rule parts are OPTIONAL, + ; but MUST NOT occur more than once. + + recur-rule-part = ( "FREQ" "=" freq ) + / ( "UNTIL" "=" enddate ) + / ( "COUNT" "=" 1*DIGIT ) + / ( "INTERVAL" "=" 1*DIGIT ) + / ( "BYSECOND" "=" byseclist ) + / ( "BYMINUTE" "=" byminlist ) + / ( "BYHOUR" "=" byhrlist ) + / ( "BYDAY" "=" bywdaylist ) + / ( "BYMONTHDAY" "=" bymodaylist ) + / ( "BYYEARDAY" "=" byyrdaylist ) + / ( "BYWEEKNO" "=" bywknolist ) + / ( "BYMONTH" "=" bymolist ) + / ( "BYSETPOS" "=" bysplist ) + / ( "WKST" "=" weekday ) + + freq = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" + / "WEEKLY" / "MONTHLY" / "YEARLY" + + enddate = date / date-time + + byseclist = ( seconds *("," seconds) ) + + seconds = 1*2DIGIT ;0 to 60 + + byminlist = ( minutes *("," minutes) ) + + minutes = 1*2DIGIT ;0 to 59 + + byhrlist = ( hour *("," hour) ) + + hour = 1*2DIGIT ;0 to 23 + + bywdaylist = ( weekdaynum *("," weekdaynum) ) + + weekdaynum = [[plus / minus] ordwk] weekday + + plus = "+" + + minus = "-" + + ordwk = 1*2DIGIT ;1 to 53 + + weekday = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA" + ;Corresponding to SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, + ;FRIDAY, and SATURDAY days of the week. + + + +Desruisseaux Standards Track [Page 39] + +RFC 5545 iCalendar September 2009 + + + bymodaylist = ( monthdaynum *("," monthdaynum) ) + + monthdaynum = [plus / minus] ordmoday + + ordmoday = 1*2DIGIT ;1 to 31 + + byyrdaylist = ( yeardaynum *("," yeardaynum) ) + + yeardaynum = [plus / minus] ordyrday + + ordyrday = 1*3DIGIT ;1 to 366 + + bywknolist = ( weeknum *("," weeknum) ) + + weeknum = [plus / minus] ordwk + + bymolist = ( monthnum *("," monthnum) ) + + monthnum = 1*2DIGIT ;1 to 12 + + bysplist = ( setposday *("," setposday) ) + + setposday = yeardaynum + + Description: This value type is a structured value consisting of a + list of one or more recurrence grammar parts. Each rule part is + defined by a NAME=VALUE pair. The rule parts are separated from + each other by the SEMICOLON character. The rule parts are not + ordered in any particular sequence. Individual rule parts MUST + only be specified once. Compliant applications MUST accept rule + parts ordered in any sequence, but to ensure backward + compatibility with applications that pre-date this revision of + iCalendar the FREQ rule part MUST be the first rule part specified + in a RECUR value. + + The FREQ rule part identifies the type of recurrence rule. This + rule part MUST be specified in the recurrence rule. Valid values + include SECONDLY, to specify repeating events based on an interval + of a second or more; MINUTELY, to specify repeating events based + on an interval of a minute or more; HOURLY, to specify repeating + events based on an interval of an hour or more; DAILY, to specify + repeating events based on an interval of a day or more; WEEKLY, to + specify repeating events based on an interval of a week or more; + MONTHLY, to specify repeating events based on an interval of a + month or more; and YEARLY, to specify repeating events based on an + interval of a year or more. + + + + + +Desruisseaux Standards Track [Page 40] + +RFC 5545 iCalendar September 2009 + + + The INTERVAL rule part contains a positive integer representing at + which intervals the recurrence rule repeats. The default value is + "1", meaning every second for a SECONDLY rule, every minute for a + MINUTELY rule, every hour for an HOURLY rule, every day for a + DAILY rule, every week for a WEEKLY rule, every month for a + MONTHLY rule, and every year for a YEARLY rule. For example, + within a DAILY rule, a value of "8" means every eight days. + + The UNTIL rule part defines a DATE or DATE-TIME value that bounds + the recurrence rule in an inclusive manner. If the value + specified by UNTIL is synchronized with the specified recurrence, + this DATE or DATE-TIME becomes the last instance of the + recurrence. The value of the UNTIL rule part MUST have the same + value type as the "DTSTART" property. Furthermore, if the + "DTSTART" property is specified as a date with local time, then + the UNTIL rule part MUST also be specified as a date with local + time. If the "DTSTART" property is specified as a date with UTC + time or a date with local time and time zone reference, then the + UNTIL rule part MUST be specified as a date with UTC time. In the + case of the "STANDARD" and "DAYLIGHT" sub-components the UNTIL + rule part MUST always be specified as a date with UTC time. If + specified as a DATE-TIME value, then it MUST be specified in a UTC + time format. If not present, and the COUNT rule part is also not + present, the "RRULE" is considered to repeat forever. + + The COUNT rule part defines the number of occurrences at which to + range-bound the recurrence. The "DTSTART" property value always + counts as the first occurrence. + + The BYSECOND rule part specifies a COMMA-separated list of seconds + within a minute. Valid values are 0 to 60. The BYMINUTE rule + part specifies a COMMA-separated list of minutes within an hour. + Valid values are 0 to 59. The BYHOUR rule part specifies a COMMA- + separated list of hours of the day. Valid values are 0 to 23. + The BYSECOND, BYMINUTE and BYHOUR rule parts MUST NOT be specified + when the associated "DTSTART" property has a DATE value type. + These rule parts MUST be ignored in RECUR value that violate the + above requirement (e.g., generated by applications that pre-date + this revision of iCalendar). + + The BYDAY rule part specifies a COMMA-separated list of days of + the week; SU indicates Sunday; MO indicates Monday; TU indicates + Tuesday; WE indicates Wednesday; TH indicates Thursday; FR + indicates Friday; and SA indicates Saturday. + + Each BYDAY value can also be preceded by a positive (+n) or + negative (-n) integer. If present, this indicates the nth + occurrence of a specific day within the MONTHLY or YEARLY "RRULE". + + + +Desruisseaux Standards Track [Page 41] + +RFC 5545 iCalendar September 2009 + + + For example, within a MONTHLY rule, +1MO (or simply 1MO) + represents the first Monday within the month, whereas -1MO + represents the last Monday of the month. The numeric value in a + BYDAY rule part with the FREQ rule part set to YEARLY corresponds + to an offset within the month when the BYMONTH rule part is + present, and corresponds to an offset within the year when the + BYWEEKNO or BYMONTH rule parts are present. If an integer + modifier is not present, it means all days of this type within the + specified frequency. For example, within a MONTHLY rule, MO + represents all Mondays within the month. The BYDAY rule part MUST + NOT be specified with a numeric value when the FREQ rule part is + not set to MONTHLY or YEARLY. Furthermore, the BYDAY rule part + MUST NOT be specified with a numeric value with the FREQ rule part + set to YEARLY when the BYWEEKNO rule part is specified. + + The BYMONTHDAY rule part specifies a COMMA-separated list of days + of the month. Valid values are 1 to 31 or -31 to -1. For + example, -10 represents the tenth to the last day of the month. + The BYMONTHDAY rule part MUST NOT be specified when the FREQ rule + part is set to WEEKLY. + + The BYYEARDAY rule part specifies a COMMA-separated list of days + of the year. Valid values are 1 to 366 or -366 to -1. For + example, -1 represents the last day of the year (December 31st) + and -306 represents the 306th to the last day of the year (March + 1st). The BYYEARDAY rule part MUST NOT be specified when the FREQ + rule part is set to DAILY, WEEKLY, or MONTHLY. + + The BYWEEKNO rule part specifies a COMMA-separated list of + ordinals specifying weeks of the year. Valid values are 1 to 53 + or -53 to -1. This corresponds to weeks according to week + numbering as defined in [ISO.8601.2004]. A week is defined as a + seven day period, starting on the day of the week defined to be + the week start (see WKST). Week number one of the calendar year + is the first week that contains at least four (4) days in that + calendar year. This rule part MUST NOT be used when the FREQ rule + part is set to anything other than YEARLY. For example, 3 + represents the third week of the year. + + Note: Assuming a Monday week start, week 53 can only occur when + Thursday is January 1 or if it is a leap year and Wednesday is + January 1. + + The BYMONTH rule part specifies a COMMA-separated list of months + of the year. Valid values are 1 to 12. + + The WKST rule part specifies the day on which the workweek starts. + Valid values are MO, TU, WE, TH, FR, SA, and SU. This is + + + +Desruisseaux Standards Track [Page 42] + +RFC 5545 iCalendar September 2009 + + + significant when a WEEKLY "RRULE" has an interval greater than 1, + and a BYDAY rule part is specified. This is also significant when + in a YEARLY "RRULE" when a BYWEEKNO rule part is specified. The + default value is MO. + + The BYSETPOS rule part specifies a COMMA-separated list of values + that corresponds to the nth occurrence within the set of + recurrence instances specified by the rule. BYSETPOS operates on + a set of recurrence instances in one interval of the recurrence + rule. For example, in a WEEKLY rule, the interval would be one + week A set of recurrence instances starts at the beginning of the + interval defined by the FREQ rule part. Valid values are 1 to 366 + or -366 to -1. It MUST only be used in conjunction with another + BYxxx rule part. For example "the last work day of the month" + could be represented as: + + FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1 + + Each BYSETPOS value can include a positive (+n) or negative (-n) + integer. If present, this indicates the nth occurrence of the + specific occurrence within the set of occurrences specified by the + rule. + + Recurrence rules may generate recurrence instances with an invalid + date (e.g., February 30) or nonexistent local time (e.g., 1:30 AM + on a day where the local time is moved forward by an hour at 1:00 + AM). Such recurrence instances MUST be ignored and MUST NOT be + counted as part of the recurrence set. + + Information, not contained in the rule, necessary to determine the + various recurrence instance start time and dates are derived from + the Start Time ("DTSTART") component attribute. For example, + "FREQ=YEARLY;BYMONTH=1" doesn't specify a specific day within the + month or a time. This information would be the same as what is + specified for "DTSTART". + + BYxxx rule parts modify the recurrence in some manner. BYxxx rule + parts for a period of time that is the same or greater than the + frequency generally reduce or limit the number of occurrences of + the recurrence generated. For example, "FREQ=DAILY;BYMONTH=1" + reduces the number of recurrence instances from all days (if + BYMONTH rule part is not present) to all days in January. BYxxx + rule parts for a period of time less than the frequency generally + increase or expand the number of occurrences of the recurrence. + For example, "FREQ=YEARLY;BYMONTH=1,2" increases the number of + days within the yearly recurrence set from 1 (if BYMONTH rule part + is not present) to 2. + + + + +Desruisseaux Standards Track [Page 43] + +RFC 5545 iCalendar September 2009 + + + If multiple BYxxx rule parts are specified, then after evaluating + the specified FREQ and INTERVAL rule parts, the BYxxx rule parts + are applied to the current set of evaluated occurrences in the + following order: BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY, + BYHOUR, BYMINUTE, BYSECOND and BYSETPOS; then COUNT and UNTIL are + evaluated. + + The table below summarizes the dependency of BYxxx rule part + expand or limit behavior on the FREQ rule part value. + + The term "N/A" means that the corresponding BYxxx rule part MUST + NOT be used with the corresponding FREQ value. + + BYDAY has some special behavior depending on the FREQ value and + this is described in separate notes below the table. + + +----------+--------+--------+-------+-------+------+-------+------+ + | |SECONDLY|MINUTELY|HOURLY |DAILY |WEEKLY|MONTHLY|YEARLY| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYMONTH |Limit |Limit |Limit |Limit |Limit |Limit |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYWEEKNO |N/A |N/A |N/A |N/A |N/A |N/A |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYYEARDAY |Limit |Limit |Limit |N/A |N/A |N/A |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYMONTHDAY|Limit |Limit |Limit |Limit |N/A |Expand |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYDAY |Limit |Limit |Limit |Limit |Expand|Note 1 |Note 2| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYHOUR |Limit |Limit |Limit |Expand |Expand|Expand |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYMINUTE |Limit |Limit |Expand |Expand |Expand|Expand |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYSECOND |Limit |Expand |Expand |Expand |Expand|Expand |Expand| + +----------+--------+--------+-------+-------+------+-------+------+ + |BYSETPOS |Limit |Limit |Limit |Limit |Limit |Limit |Limit | + +----------+--------+--------+-------+-------+------+-------+------+ + + Note 1: Limit if BYMONTHDAY is present; otherwise, special expand + for MONTHLY. + + Note 2: Limit if BYYEARDAY or BYMONTHDAY is present; otherwise, + special expand for WEEKLY if BYWEEKNO present; otherwise, + special expand for MONTHLY if BYMONTH present; otherwise, + special expand for YEARLY. + + + + + + +Desruisseaux Standards Track [Page 44] + +RFC 5545 iCalendar September 2009 + + + Here is an example of evaluating multiple BYxxx rule parts. + + DTSTART;TZID=America/New_York:19970105T083000 + RRULE:FREQ=YEARLY;INTERVAL=2;BYMONTH=1;BYDAY=SU;BYHOUR=8,9; + BYMINUTE=30 + + First, the "INTERVAL=2" would be applied to "FREQ=YEARLY" to + arrive at "every other year". Then, "BYMONTH=1" would be applied + to arrive at "every January, every other year". Then, "BYDAY=SU" + would be applied to arrive at "every Sunday in January, every + other year". Then, "BYHOUR=8,9" would be applied to arrive at + "every Sunday in January at 8 AM and 9 AM, every other year". + Then, "BYMINUTE=30" would be applied to arrive at "every Sunday in + January at 8:30 AM and 9:30 AM, every other year". Then, lacking + information from "RRULE", the second is derived from "DTSTART", to + end up in "every Sunday in January at 8:30:00 AM and 9:30:00 AM, + every other year". Similarly, if the BYMINUTE, BYHOUR, BYDAY, + BYMONTHDAY, or BYMONTH rule part were missing, the appropriate + minute, hour, day, or month would have been retrieved from the + "DTSTART" property. + + If the computed local start time of a recurrence instance does not + exist, or occurs more than once, for the specified time zone, the + time of the recurrence instance is interpreted in the same manner + as an explicit DATE-TIME value describing that date and time, as + specified in Section 3.3.5. + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + Example: The following is a rule that specifies 10 occurrences that + occur every other day: + + FREQ=DAILY;COUNT=10;INTERVAL=2 + + There are other examples specified in Section 3.8.5.3. + +3.3.11. Text + + Value Name: TEXT + + Purpose: This value type is used to identify values that contain + human-readable text. + + Format Definition: This value type is defined by the following + notation: + + + + + +Desruisseaux Standards Track [Page 45] + +RFC 5545 iCalendar September 2009 + + + text = *(TSAFE-CHAR / ":" / DQUOTE / ESCAPED-CHAR) + ; Folded according to description above + + ESCAPED-CHAR = ("\\" / "\;" / "\," / "\N" / "\n") + ; \\ encodes \, \N or \n encodes newline + ; \; encodes ;, \, encodes , + + TSAFE-CHAR = WSP / %x21 / %x23-2B / %x2D-39 / %x3C-5B / + %x5D-7E / NON-US-ASCII + ; Any character except CONTROLs not needed by the current + ; character set, DQUOTE, ";", ":", "\", "," + + Description: If the property permits, multiple TEXT values are + specified by a COMMA-separated list of values. + + The language in which the text is represented can be controlled by + the "LANGUAGE" property parameter. + + An intentional formatted text line break MUST only be included in + a "TEXT" property value by representing the line break with the + character sequence of BACKSLASH, followed by a LATIN SMALL LETTER + N or a LATIN CAPITAL LETTER N, that is "\n" or "\N". + + The "TEXT" property values may also contain special characters + that are used to signify delimiters, such as a COMMA character for + lists of values or a SEMICOLON character for structured values. + In order to support the inclusion of these special characters in + "TEXT" property values, they MUST be escaped with a BACKSLASH + character. A BACKSLASH character in a "TEXT" property value MUST + be escaped with another BACKSLASH character. A COMMA character in + a "TEXT" property value MUST be escaped with a BACKSLASH + character. A SEMICOLON character in a "TEXT" property value MUST + be escaped with a BACKSLASH character. However, a COLON character + in a "TEXT" property value SHALL NOT be escaped with a BACKSLASH + character. + + Example: A multiple line value of: + + Project XYZ Final Review + Conference Room - 3B + Come Prepared. + + would be represented as: + + Project XYZ Final Review\nConference Room - 3B\nCome Prepared. + + + + + + +Desruisseaux Standards Track [Page 46] + +RFC 5545 iCalendar September 2009 + + +3.3.12. Time + + Value Name: TIME + + Purpose: This value type is used to identify values that contain a + time of day. + + Format Definition: This value type is defined by the following + notation: + + time = time-hour time-minute time-second [time-utc] + + time-hour = 2DIGIT ;00-23 + time-minute = 2DIGIT ;00-59 + time-second = 2DIGIT ;00-60 + ;The "60" value is used to account for positive "leap" seconds. + + time-utc = "Z" + + Description: If the property permits, multiple "time" values are + specified by a COMMA-separated list of values. No additional + content value encoding (i.e., BACKSLASH character encoding, see + Section 3.3.11) is defined for this value type. + + The "TIME" value type is used to identify values that contain a + time of day. The format is based on the [ISO.8601.2004] complete + representation, basic format for a time of day. The text format + consists of a two-digit, 24-hour of the day (i.e., values 00-23), + two-digit minute in the hour (i.e., values 00-59), and two-digit + seconds in the minute (i.e., values 00-60). The seconds value of + 60 MUST only be used to account for positive "leap" seconds. + Fractions of a second are not supported by this format. + + In parallel to the "DATE-TIME" definition above, the "TIME" value + type expresses time values in three forms: + + The form of time with UTC offset MUST NOT be used. For example, + the following is not valid for a time value: + + 230000-0800 ;Invalid time format + + FORM #1 LOCAL TIME + + The local time form is simply a time value that does not contain + the UTC designator nor does it reference a time zone. For + example, 11:00 PM: + + 230000 + + + +Desruisseaux Standards Track [Page 47] + +RFC 5545 iCalendar September 2009 + + + Time values of this type are said to be "floating" and are not + bound to any time zone in particular. They are used to represent + the same hour, minute, and second value regardless of which time + zone is currently being observed. For example, an event can be + defined that indicates that an individual will be busy from 11:00 + AM to 1:00 PM every day, no matter which time zone the person is + in. In these cases, a local time can be specified. The recipient + of an iCalendar object with a property value consisting of a local + time, without any relative time zone information, SHOULD interpret + the value as being fixed to whatever time zone the "ATTENDEE" is + in at any given moment. This means that two "Attendees", may + participate in the same event at different UTC times; floating + time SHOULD only be used where that is reasonable behavior. + + In most cases, a fixed time is desired. To properly communicate a + fixed time in a property value, either UTC time or local time with + time zone reference MUST be specified. + + The use of local time in a TIME value without the "TZID" property + parameter is to be interpreted as floating time, regardless of the + existence of "VTIMEZONE" calendar components in the iCalendar + object. + + FORM #2: UTC TIME + + UTC time, or absolute time, is identified by a LATIN CAPITAL + LETTER Z suffix character, the UTC designator, appended to the + time value. For example, the following represents 07:00 AM UTC: + + 070000Z + + The "TZID" property parameter MUST NOT be applied to TIME + properties whose time values are specified in UTC. + + FORM #3: LOCAL TIME AND TIME ZONE REFERENCE + + The local time with reference to time zone information form is + identified by the use the "TZID" property parameter to reference + the appropriate time zone definition. "TZID" is discussed in + detail in Section 3.2.19. + + Example: The following represents 8:30 AM in New York in winter, + five hours behind UTC, in each of the three formats: + + 083000 + 133000Z + TZID=America/New_York:083000 + + + + +Desruisseaux Standards Track [Page 48] + +RFC 5545 iCalendar September 2009 + + +3.3.13. URI + + Value Name: URI + + Purpose: This value type is used to identify values that contain a + uniform resource identifier (URI) type of reference to the + property value. + + Format Definition: This value type is defined by the following + notation: + + uri = + + Description: This value type might be used to reference binary + information, for values that are large, or otherwise undesirable + to include directly in the iCalendar object. + + Property values with this value type MUST follow the generic URI + syntax defined in [RFC3986]. + + When a property parameter value is a URI value type, the URI MUST + be specified as a quoted-string value. + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + Example: The following is a URI for a network file: + + http://example.com/my-report.txt + +3.3.14. UTC Offset + + Value Name: UTC-OFFSET + + Purpose: This value type is used to identify properties that contain + an offset from UTC to local time. + + Format Definition: This value type is defined by the following + notation: + + utc-offset = time-numzone + + time-numzone = ("+" / "-") time-hour time-minute [time-second] + + Description: The PLUS SIGN character MUST be specified for positive + UTC offsets (i.e., ahead of UTC). The HYPHEN-MINUS character MUST + be specified for negative UTC offsets (i.e., behind of UTC). The + + + + +Desruisseaux Standards Track [Page 49] + +RFC 5545 iCalendar September 2009 + + + value of "-0000" and "-000000" are not allowed. The time-second, + if present, MUST NOT be 60; if absent, it defaults to zero. + + No additional content value encoding (i.e., BACKSLASH character + encoding, see Section 3.3.11) is defined for this value type. + + Example: The following UTC offsets are given for standard time for + New York (five hours behind UTC) and Geneva (one hour ahead of + UTC): + + -0500 + + +0100 + +3.4. iCalendar Object + + The Calendaring and Scheduling Core Object is a collection of + calendaring and scheduling information. Typically, this information + will consist of an iCalendar stream with a single iCalendar object. + However, multiple iCalendar objects can be sequentially grouped + together in an iCalendar stream. The first line and last line of the + iCalendar object MUST contain a pair of iCalendar object delimiter + strings. The syntax for an iCalendar stream is as follows: + + icalstream = 1*icalobject + + icalobject = "BEGIN" ":" "VCALENDAR" CRLF + icalbody + "END" ":" "VCALENDAR" CRLF + + The following is a simple example of an iCalendar object: + + BEGIN:VCALENDAR + VERSION:2.0 + PRODID:-//hacksw/handcal//NONSGML v1.0//EN + BEGIN:VEVENT + UID:19970610T172345Z-AF23B2@example.com + DTSTAMP:19970610T172345Z + DTSTART:19970714T170000Z + DTEND:19970715T040000Z + SUMMARY:Bastille Day Party + END:VEVENT + END:VCALENDAR + + + + + + + + +Desruisseaux Standards Track [Page 50] + +RFC 5545 iCalendar September 2009 + + +3.5. Property + + A property is the definition of an individual attribute describing a + calendar object or a calendar component. A property takes the form + defined by the "contentline" notation defined in Section 3.1. + + The following is an example of a property: + + DTSTART:19960415T133000Z + + This memo imposes no ordering of properties within an iCalendar + object. + + Property names, parameter names, and enumerated parameter values are + case-insensitive. For example, the property name "DUE" is the same + as "due" and "Due", DTSTART;TZID=America/New_York:19980714T120000 is + the same as DtStart;TzID=America/New_York:19980714T120000. + +3.6. Calendar Components + + The body of the iCalendar object consists of a sequence of calendar + properties and one or more calendar components. The calendar + properties are attributes that apply to the calendar object as a + whole. The calendar components are collections of properties that + express a particular calendar semantic. For example, the calendar + component can specify an event, a to-do, a journal entry, time zone + information, free/busy time information, or an alarm. + + The body of the iCalendar object is defined by the following + notation: + + icalbody = calprops component + + calprops = *( + ; + ; The following are REQUIRED, + ; but MUST NOT occur more than once. + ; + prodid / version / + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + calscale / method / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + + + +Desruisseaux Standards Track [Page 51] + +RFC 5545 iCalendar September 2009 + + + x-prop / iana-prop + ; + ) + + component = 1*(eventc / todoc / journalc / freebusyc / + timezonec / iana-comp / x-comp) + + iana-comp = "BEGIN" ":" iana-token CRLF + 1*contentline + "END" ":" iana-token CRLF + + x-comp = "BEGIN" ":" x-name CRLF + 1*contentline + "END" ":" x-name CRLF + + An iCalendar object MUST include the "PRODID" and "VERSION" calendar + properties. In addition, it MUST include at least one calendar + component. Special forms of iCalendar objects are possible to + publish just busy time (i.e., only a "VFREEBUSY" calendar component) + or time zone (i.e., only a "VTIMEZONE" calendar component) + information. In addition, a complex iCalendar object that is used to + capture a complete snapshot of the contents of a calendar is possible + (e.g., composite of many different calendar components). More + commonly, an iCalendar object will consist of just a single "VEVENT", + "VTODO", or "VJOURNAL" calendar component. Applications MUST ignore + x-comp and iana-comp values they don't recognize. Applications that + support importing iCalendar objects SHOULD support all of the + component types defined in this document, and SHOULD NOT silently + drop any components as that can lead to user data loss. + +3.6.1. Event Component + + Component Name: VEVENT + + Purpose: Provide a grouping of component properties that describe an + event. + + Format Definition: A "VEVENT" calendar component is defined by the + following notation: + + eventc = "BEGIN" ":" "VEVENT" CRLF + eventprop *alarmc + "END" ":" "VEVENT" CRLF + + eventprop = *( + ; + ; The following are REQUIRED, + ; but MUST NOT occur more than once. + + + +Desruisseaux Standards Track [Page 52] + +RFC 5545 iCalendar September 2009 + + + ; + dtstamp / uid / + ; + ; The following is REQUIRED if the component + ; appears in an iCalendar object that doesn't + ; specify the "METHOD" property; otherwise, it + ; is OPTIONAL; in any case, it MUST NOT occur + ; more than once. + ; + dtstart / + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + class / created / description / geo / + last-mod / location / organizer / priority / + seq / status / summary / transp / + url / recurid / + ; + ; The following is OPTIONAL, + ; but SHOULD NOT occur more than once. + ; + rrule / + ; + ; Either 'dtend' or 'duration' MAY appear in + ; a 'eventprop', but 'dtend' and 'duration' + ; MUST NOT occur in the same 'eventprop'. + ; + dtend / duration / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + attach / attendee / categories / comment / + contact / exdate / rstatus / related / + resources / rdate / x-prop / iana-prop + ; + ) + + Description: A "VEVENT" calendar component is a grouping of + component properties, possibly including "VALARM" calendar + components, that represents a scheduled amount of time on a + calendar. For example, it can be an activity; such as a one-hour + long, department meeting from 8:00 AM to 9:00 AM, tomorrow. + Generally, an event will take up time on an individual calendar. + Hence, the event will appear as an opaque interval in a search for + busy time. Alternately, the event can have its Time Transparency + + + + +Desruisseaux Standards Track [Page 53] + +RFC 5545 iCalendar September 2009 + + + set to "TRANSPARENT" in order to prevent blocking of the event in + searches for busy time. + + The "VEVENT" is also the calendar component used to specify an + anniversary or daily reminder within a calendar. These events + have a DATE value type for the "DTSTART" property instead of the + default value type of DATE-TIME. If such a "VEVENT" has a "DTEND" + property, it MUST be specified as a DATE value also. The + anniversary type of "VEVENT" can span more than one date (i.e., + "DTEND" property value is set to a calendar date after the + "DTSTART" property value). If such a "VEVENT" has a "DURATION" + property, it MUST be specified as a "dur-day" or "dur-week" value. + + The "DTSTART" property for a "VEVENT" specifies the inclusive + start of the event. For recurring events, it also specifies the + very first instance in the recurrence set. The "DTEND" property + for a "VEVENT" calendar component specifies the non-inclusive end + of the event. For cases where a "VEVENT" calendar component + specifies a "DTSTART" property with a DATE value type but no + "DTEND" nor "DURATION" property, the event's duration is taken to + be one day. For cases where a "VEVENT" calendar component + specifies a "DTSTART" property with a DATE-TIME value type but no + "DTEND" property, the event ends on the same calendar date and + time of day specified by the "DTSTART" property. + + The "VEVENT" calendar component cannot be nested within another + calendar component. However, "VEVENT" calendar components can be + related to each other or to a "VTODO" or to a "VJOURNAL" calendar + component with the "RELATED-TO" property. + + Example: The following is an example of the "VEVENT" calendar + component used to represent a meeting that will also be opaque to + searches for busy time: + + BEGIN:VEVENT + UID:19970901T130000Z-123401@example.com + DTSTAMP:19970901T130000Z + DTSTART:19970903T163000Z + DTEND:19970903T190000Z + SUMMARY:Annual Employee Review + CLASS:PRIVATE + CATEGORIES:BUSINESS,HUMAN RESOURCES + END:VEVENT + + The following is an example of the "VEVENT" calendar component + used to represent a reminder that will not be opaque, but rather + transparent, to searches for busy time: + + + + +Desruisseaux Standards Track [Page 54] + +RFC 5545 iCalendar September 2009 + + + BEGIN:VEVENT + UID:19970901T130000Z-123402@example.com + DTSTAMP:19970901T130000Z + DTSTART:19970401T163000Z + DTEND:19970402T010000Z + SUMMARY:Laurel is in sensitivity awareness class. + CLASS:PUBLIC + CATEGORIES:BUSINESS,HUMAN RESOURCES + TRANSP:TRANSPARENT + END:VEVENT + + The following is an example of the "VEVENT" calendar component + used to represent an anniversary that will occur annually: + + BEGIN:VEVENT + UID:19970901T130000Z-123403@example.com + DTSTAMP:19970901T130000Z + DTSTART;VALUE=DATE:19971102 + SUMMARY:Our Blissful Anniversary + TRANSP:TRANSPARENT + CLASS:CONFIDENTIAL + CATEGORIES:ANNIVERSARY,PERSONAL,SPECIAL OCCASION + RRULE:FREQ=YEARLY + END:VEVENT + + The following is an example of the "VEVENT" calendar component + used to represent a multi-day event scheduled from June 28th, 2007 + to July 8th, 2007 inclusively. Note that the "DTEND" property is + set to July 9th, 2007, since the "DTEND" property specifies the + non-inclusive end of the event. + + BEGIN:VEVENT + UID:20070423T123432Z-541111@example.com + DTSTAMP:20070423T123432Z + DTSTART;VALUE=DATE:20070628 + DTEND;VALUE=DATE:20070709 + SUMMARY:Festival International de Jazz de Montreal + TRANSP:TRANSPARENT + END:VEVENT + +3.6.2. To-Do Component + + Component Name: VTODO + + Purpose: Provide a grouping of calendar properties that describe a + to-do. + + + + + +Desruisseaux Standards Track [Page 55] + +RFC 5545 iCalendar September 2009 + + + Format Definition: A "VTODO" calendar component is defined by the + following notation: + + todoc = "BEGIN" ":" "VTODO" CRLF + todoprop *alarmc + "END" ":" "VTODO" CRLF + + todoprop = *( + ; + ; The following are REQUIRED, + ; but MUST NOT occur more than once. + ; + dtstamp / uid / + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + class / completed / created / description / + dtstart / geo / last-mod / location / organizer / + percent / priority / recurid / seq / status / + summary / url / + ; + ; The following is OPTIONAL, + ; but SHOULD NOT occur more than once. + ; + rrule / + ; + ; Either 'due' or 'duration' MAY appear in + ; a 'todoprop', but 'due' and 'duration' + ; MUST NOT occur in the same 'todoprop'. + ; If 'duration' appear in a 'todoprop', + ; then 'dtstart' MUST also appear in + ; the same 'todoprop'. + ; + due / duration / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + attach / attendee / categories / comment / contact / + exdate / rstatus / related / resources / + rdate / x-prop / iana-prop + ; + ) + + Description: A "VTODO" calendar component is a grouping of component + properties and possibly "VALARM" calendar components that + represent an action-item or assignment. For example, it can be + + + +Desruisseaux Standards Track [Page 56] + +RFC 5545 iCalendar September 2009 + + + used to represent an item of work assigned to an individual; such + as "turn in travel expense today". + + The "VTODO" calendar component cannot be nested within another + calendar component. However, "VTODO" calendar components can be + related to each other or to a "VEVENT" or to a "VJOURNAL" calendar + component with the "RELATED-TO" property. + + A "VTODO" calendar component without the "DTSTART" and "DUE" (or + "DURATION") properties specifies a to-do that will be associated + with each successive calendar date, until it is completed. + + Examples: The following is an example of a "VTODO" calendar + component that needs to be completed before May 1st, 2007. On + midnight May 1st, 2007 this to-do would be considered overdue. + + BEGIN:VTODO + UID:20070313T123432Z-456553@example.com + DTSTAMP:20070313T123432Z + DUE;VALUE=DATE:20070501 + SUMMARY:Submit Quebec Income Tax Return for 2006 + CLASS:CONFIDENTIAL + CATEGORIES:FAMILY,FINANCE + STATUS:NEEDS-ACTION + END:VTODO + + The following is an example of a "VTODO" calendar component that + was due before 1:00 P.M. UTC on July 9th, 2007 and was completed + on July 7th, 2007 at 10:00 A.M. UTC. + + BEGIN:VTODO + UID:20070514T103211Z-123404@example.com + DTSTAMP:20070514T103211Z + DTSTART:20070514T110000Z + DUE:20070709T130000Z + COMPLETED:20070707T100000Z + SUMMARY:Submit Revised Internet-Draft + PRIORITY:1 + STATUS:NEEDS-ACTION + END:VTODO + +3.6.3. Journal Component + + Component Name: VJOURNAL + + Purpose: Provide a grouping of component properties that describe a + journal entry. + + + + +Desruisseaux Standards Track [Page 57] + +RFC 5545 iCalendar September 2009 + + + Format Definition: A "VJOURNAL" calendar component is defined by the + following notation: + + journalc = "BEGIN" ":" "VJOURNAL" CRLF + jourprop + "END" ":" "VJOURNAL" CRLF + + jourprop = *( + ; + ; The following are REQUIRED, + ; but MUST NOT occur more than once. + ; + dtstamp / uid / + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + class / created / dtstart / + last-mod / organizer / recurid / seq / + status / summary / url / + ; + ; The following is OPTIONAL, + ; but SHOULD NOT occur more than once. + ; + rrule / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + attach / attendee / categories / comment / + contact / description / exdate / related / rdate / + rstatus / x-prop / iana-prop + ; + ) + + Description: A "VJOURNAL" calendar component is a grouping of + component properties that represent one or more descriptive text + notes associated with a particular calendar date. The "DTSTART" + property is used to specify the calendar date with which the + journal entry is associated. Generally, it will have a DATE value + data type, but it can also be used to specify a DATE-TIME value + data type. Examples of a journal entry include a daily record of + a legislative body or a journal entry of individual telephone + contacts for the day or an ordered list of accomplishments for the + day. The "VJOURNAL" calendar component can also be used to + associate a document with a calendar date. + + + + + +Desruisseaux Standards Track [Page 58] + +RFC 5545 iCalendar September 2009 + + + The "VJOURNAL" calendar component does not take up time on a + calendar. Hence, it does not play a role in free or busy time + searches -- it is as though it has a time transparency value of + TRANSPARENT. It is transparent to any such searches. + + The "VJOURNAL" calendar component cannot be nested within another + calendar component. However, "VJOURNAL" calendar components can + be related to each other or to a "VEVENT" or to a "VTODO" calendar + component, with the "RELATED-TO" property. + + Example: The following is an example of the "VJOURNAL" calendar + component: + + BEGIN:VJOURNAL + UID:19970901T130000Z-123405@example.com + DTSTAMP:19970901T130000Z + DTSTART;VALUE=DATE:19970317 + SUMMARY:Staff meeting minutes + DESCRIPTION:1. Staff meeting: Participants include Joe\, + Lisa\, and Bob. Aurora project plans were reviewed. + There is currently no budget reserves for this project. + Lisa will escalate to management. Next meeting on Tuesday.\n + 2. Telephone Conference: ABC Corp. sales representative + called to discuss new printer. Promised to get us a demo by + Friday.\n3. Henry Miller (Handsoff Insurance): Car was + totaled by tree. Is looking into a loaner car. 555-2323 + (tel). + END:VJOURNAL + +3.6.4. Free/Busy Component + + Component Name: VFREEBUSY + + Purpose: Provide a grouping of component properties that describe + either a request for free/busy time, describe a response to a + request for free/busy time, or describe a published set of busy + time. + + Format Definition: A "VFREEBUSY" calendar component is defined by + the following notation: + + freebusyc = "BEGIN" ":" "VFREEBUSY" CRLF + fbprop + "END" ":" "VFREEBUSY" CRLF + + fbprop = *( + ; + ; The following are REQUIRED, + + + +Desruisseaux Standards Track [Page 59] + +RFC 5545 iCalendar September 2009 + + + ; but MUST NOT occur more than once. + ; + dtstamp / uid / + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + contact / dtstart / dtend / + organizer / url / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + attendee / comment / freebusy / rstatus / x-prop / + iana-prop + ; + ) + + Description: A "VFREEBUSY" calendar component is a grouping of + component properties that represents either a request for free or + busy time information, a reply to a request for free or busy time + information, or a published set of busy time information. + + When used to request free/busy time information, the "ATTENDEE" + property specifies the calendar users whose free/busy time is + being requested; the "ORGANIZER" property specifies the calendar + user who is requesting the free/busy time; the "DTSTART" and + "DTEND" properties specify the window of time for which the free/ + busy time is being requested; the "UID" and "DTSTAMP" properties + are specified to assist in proper sequencing of multiple free/busy + time requests. + + When used to reply to a request for free/busy time, the "ATTENDEE" + property specifies the calendar user responding to the free/busy + time request; the "ORGANIZER" property specifies the calendar user + that originally requested the free/busy time; the "FREEBUSY" + property specifies the free/busy time information (if it exists); + and the "UID" and "DTSTAMP" properties are specified to assist in + proper sequencing of multiple free/busy time replies. + + When used to publish busy time, the "ORGANIZER" property specifies + the calendar user associated with the published busy time; the + "DTSTART" and "DTEND" properties specify an inclusive time window + that surrounds the busy time information; the "FREEBUSY" property + specifies the published busy time information; and the "DTSTAMP" + property specifies the DATE-TIME that iCalendar object was + created. + + + + +Desruisseaux Standards Track [Page 60] + +RFC 5545 iCalendar September 2009 + + + The "VFREEBUSY" calendar component cannot be nested within another + calendar component. Multiple "VFREEBUSY" calendar components can + be specified within an iCalendar object. This permits the + grouping of free/busy information into logical collections, such + as monthly groups of busy time information. + + The "VFREEBUSY" calendar component is intended for use in + iCalendar object methods involving requests for free time, + requests for busy time, requests for both free and busy, and the + associated replies. + + Free/Busy information is represented with the "FREEBUSY" property. + This property provides a terse representation of time periods. + One or more "FREEBUSY" properties can be specified in the + "VFREEBUSY" calendar component. + + When present in a "VFREEBUSY" calendar component, the "DTSTART" + and "DTEND" properties SHOULD be specified prior to any "FREEBUSY" + properties. + + The recurrence properties ("RRULE", "RDATE", "EXDATE") are not + permitted within a "VFREEBUSY" calendar component. Any recurring + events are resolved into their individual busy time periods using + the "FREEBUSY" property. + + Example: The following is an example of a "VFREEBUSY" calendar + component used to request free or busy time information: + + BEGIN:VFREEBUSY + UID:19970901T082949Z-FA43EF@example.com + ORGANIZER:mailto:jane_doe@example.com + ATTENDEE:mailto:john_public@example.com + DTSTART:19971015T050000Z + DTEND:19971016T050000Z + DTSTAMP:19970901T083000Z + END:VFREEBUSY + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 61] + +RFC 5545 iCalendar September 2009 + + + The following is an example of a "VFREEBUSY" calendar component + used to reply to the request with busy time information: + + BEGIN:VFREEBUSY + UID:19970901T095957Z-76A912@example.com + ORGANIZER:mailto:jane_doe@example.com + ATTENDEE:mailto:john_public@example.com + DTSTAMP:19970901T100000Z + FREEBUSY:19971015T050000Z/PT8H30M, + 19971015T160000Z/PT5H30M,19971015T223000Z/PT6H30M + URL:http://example.com/pub/busy/jpublic-01.ifb + COMMENT:This iCalendar file contains busy time information for + the next three months. + END:VFREEBUSY + + The following is an example of a "VFREEBUSY" calendar component + used to publish busy time information: + + BEGIN:VFREEBUSY + UID:19970901T115957Z-76A912@example.com + DTSTAMP:19970901T120000Z + ORGANIZER:jsmith@example.com + DTSTART:19980313T141711Z + DTEND:19980410T141711Z + FREEBUSY:19980314T233000Z/19980315T003000Z + FREEBUSY:19980316T153000Z/19980316T163000Z + FREEBUSY:19980318T030000Z/19980318T040000Z + URL:http://www.example.com/calendar/busytime/jsmith.ifb + END:VFREEBUSY + +3.6.5. Time Zone Component + + Component Name: VTIMEZONE + + Purpose: Provide a grouping of component properties that defines a + time zone. + + Format Definition: A "VTIMEZONE" calendar component is defined by + the following notation: + + timezonec = "BEGIN" ":" "VTIMEZONE" CRLF + *( + ; + ; 'tzid' is REQUIRED, but MUST NOT occur more + ; than once. + ; + tzid / + ; + + + +Desruisseaux Standards Track [Page 62] + +RFC 5545 iCalendar September 2009 + + + ; 'last-mod' and 'tzurl' are OPTIONAL, + ; but MUST NOT occur more than once. + ; + last-mod / tzurl / + ; + ; One of 'standardc' or 'daylightc' MUST occur + ; and each MAY occur more than once. + ; + standardc / daylightc / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + x-prop / iana-prop + ; + ) + "END" ":" "VTIMEZONE" CRLF + + standardc = "BEGIN" ":" "STANDARD" CRLF + tzprop + "END" ":" "STANDARD" CRLF + + daylightc = "BEGIN" ":" "DAYLIGHT" CRLF + tzprop + "END" ":" "DAYLIGHT" CRLF + + tzprop = *( + ; + ; The following are REQUIRED, + ; but MUST NOT occur more than once. + ; + dtstart / tzoffsetto / tzoffsetfrom / + ; + ; The following is OPTIONAL, + ; but SHOULD NOT occur more than once. + ; + rrule / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + comment / rdate / tzname / x-prop / iana-prop + ; + ) + + Description: A time zone is unambiguously defined by the set of time + measurement rules determined by the governing body for a given + geographic area. These rules describe, at a minimum, the base + + + +Desruisseaux Standards Track [Page 63] + +RFC 5545 iCalendar September 2009 + + + offset from UTC for the time zone, often referred to as the + Standard Time offset. Many locations adjust their Standard Time + forward or backward by one hour, in order to accommodate seasonal + changes in number of daylight hours, often referred to as Daylight + Saving Time. Some locations adjust their time by a fraction of an + hour. Standard Time is also known as Winter Time. Daylight + Saving Time is also known as Advanced Time, Summer Time, or Legal + Time in certain countries. The following table shows the changes + in time zone rules in effect for New York City starting from 1967. + Each line represents a description or rule for a particular + observance. + + Effective Observance Rule + + +-----------+--------------------------+--------+--------------+ + | Date | (Date-Time) | Offset | Abbreviation | + +-----------+--------------------------+--------+--------------+ + | 1967-1973 | last Sun in Apr, 02:00 | -0400 | EDT | + | | | | | + | 1967-2006 | last Sun in Oct, 02:00 | -0500 | EST | + | | | | | + | 1974-1974 | Jan 6, 02:00 | -0400 | EDT | + | | | | | + | 1975-1975 | Feb 23, 02:00 | -0400 | EDT | + | | | | | + | 1976-1986 | last Sun in Apr, 02:00 | -0400 | EDT | + | | | | | + | 1987-2006 | first Sun in Apr, 02:00 | -0400 | EDT | + | | | | | + | 2007-* | second Sun in Mar, 02:00 | -0400 | EDT | + | | | | | + | 2007-* | first Sun in Nov, 02:00 | -0500 | EST | + +-----------+--------------------------+--------+--------------+ + + Note: The specification of a global time zone registry is not + addressed by this document and is left for future study. + However, implementers may find the TZ database [TZDB] a useful + reference. It is an informal, public-domain collection of time + zone information, which is currently being maintained by + volunteer Internet participants, and is used in several + operating systems. This database contains current and + historical time zone information for a wide variety of + locations around the globe; it provides a time zone identifier + for every unique time zone rule set in actual use since 1970, + with historical data going back to the introduction of standard + time. + + + + + +Desruisseaux Standards Track [Page 64] + +RFC 5545 iCalendar September 2009 + + + Interoperability between two calendaring and scheduling + applications, especially for recurring events, to-dos or journal + entries, is dependent on the ability to capture and convey date + and time information in an unambiguous format. The specification + of current time zone information is integral to this behavior. + + If present, the "VTIMEZONE" calendar component defines the set of + Standard Time and Daylight Saving Time observances (or rules) for + a particular time zone for a given interval of time. The + "VTIMEZONE" calendar component cannot be nested within other + calendar components. Multiple "VTIMEZONE" calendar components can + exist in an iCalendar object. In this situation, each "VTIMEZONE" + MUST represent a unique time zone definition. This is necessary + for some classes of events, such as airline flights, that start in + one time zone and end in another. + + The "VTIMEZONE" calendar component MUST include the "TZID" + property and at least one definition of a "STANDARD" or "DAYLIGHT" + sub-component. The "STANDARD" or "DAYLIGHT" sub-component MUST + include the "DTSTART", "TZOFFSETFROM", and "TZOFFSETTO" + properties. + + An individual "VTIMEZONE" calendar component MUST be specified for + each unique "TZID" parameter value specified in the iCalendar + object. In addition, a "VTIMEZONE" calendar component, referred + to by a recurring calendar component, MUST provide valid time zone + information for all recurrence instances. + + Each "VTIMEZONE" calendar component consists of a collection of + one or more sub-components that describe the rule for a particular + observance (either a Standard Time or a Daylight Saving Time + observance). The "STANDARD" sub-component consists of a + collection of properties that describe Standard Time. The + "DAYLIGHT" sub-component consists of a collection of properties + that describe Daylight Saving Time. In general, this collection + of properties consists of: + + * the first onset DATE-TIME for the observance; + + * the last onset DATE-TIME for the observance, if a last onset is + known; + + * the offset to be applied for the observance; + + * a rule that describes the day and time when the observance + takes effect; + + * an optional name for the observance. + + + +Desruisseaux Standards Track [Page 65] + +RFC 5545 iCalendar September 2009 + + + For a given time zone, there may be multiple unique definitions of + the observances over a period of time. Each observance is + described using either a "STANDARD" or "DAYLIGHT" sub-component. + The collection of these sub-components is used to describe the + time zone for a given period of time. The offset to apply at any + given time is found by locating the observance that has the last + onset date and time before the time in question, and using the + offset value from that observance. + + The top-level properties in a "VTIMEZONE" calendar component are: + + The mandatory "TZID" property is a text value that uniquely + identifies the "VTIMEZONE" calendar component within the scope of + an iCalendar object. + + The optional "LAST-MODIFIED" property is a UTC value that + specifies the date and time that this time zone definition was + last updated. + + The optional "TZURL" property is a url value that points to a + published "VTIMEZONE" definition. "TZURL" SHOULD refer to a + resource that is accessible by anyone who might need to interpret + the object. This SHOULD NOT normally be a "file" URL or other URL + that is not widely accessible. + + The collection of properties that are used to define the + "STANDARD" and "DAYLIGHT" sub-components include: + + The mandatory "DTSTART" property gives the effective onset date + and local time for the time zone sub-component definition. + "DTSTART" in this usage MUST be specified as a date with a local + time value. + + The mandatory "TZOFFSETFROM" property gives the UTC offset that is + in use when the onset of this time zone observance begins. + "TZOFFSETFROM" is combined with "DTSTART" to define the effective + onset for the time zone sub-component definition. For example, + the following represents the time at which the observance of + Standard Time took effect in Fall 1967 for New York City: + + DTSTART:19671029T020000 + + TZOFFSETFROM:-0400 + + The mandatory "TZOFFSETTO" property gives the UTC offset for the + time zone sub-component (Standard Time or Daylight Saving Time) + when this observance is in use. + + + + +Desruisseaux Standards Track [Page 66] + +RFC 5545 iCalendar September 2009 + + + The optional "TZNAME" property is the customary name for the time + zone. This could be used for displaying dates. + + The onset DATE-TIME values for the observance defined by the time + zone sub-component is defined by the "DTSTART", "RRULE", and + "RDATE" properties. + + The "RRULE" property defines the recurrence rule for the onset of + the observance defined by this time zone sub-component. Some + specific requirements for the usage of "RRULE" for this purpose + include: + + * If observance is known to have an effective end date, the + "UNTIL" recurrence rule parameter MUST be used to specify the + last valid onset of this observance (i.e., the UNTIL DATE-TIME + will be equal to the last instance generated by the recurrence + pattern). It MUST be specified in UTC time. + + * The "DTSTART" and the "TZOFFSETFROM" properties MUST be used + when generating the onset DATE-TIME values (instances) from the + "RRULE". + + The "RDATE" property can also be used to define the onset of the + observance by giving the individual onset date and times. "RDATE" + in this usage MUST be specified as a date with local time value, + relative to the UTC offset specified in the "TZOFFSETFROM" + property. + + The optional "COMMENT" property is also allowed for descriptive + explanatory text. + + Example: The following are examples of the "VTIMEZONE" calendar + component: + + This is an example showing all the time zone rules for New York + City since April 30, 1967 at 03:00:00 EDT. + + BEGIN:VTIMEZONE + TZID:America/New_York + LAST-MODIFIED:20050809T050000Z + BEGIN:DAYLIGHT + DTSTART:19670430T020000 + RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=-1SU;UNTIL=19730429T070000Z + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + BEGIN:STANDARD + + + +Desruisseaux Standards Track [Page 67] + +RFC 5545 iCalendar September 2009 + + + DTSTART:19671029T020000 + RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU;UNTIL=20061029T060000Z + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + BEGIN:DAYLIGHT + DTSTART:19740106T020000 + RDATE:19750223T020000 + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + BEGIN:DAYLIGHT + DTSTART:19760425T020000 + RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=-1SU;UNTIL=19860427T070000Z + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + BEGIN:DAYLIGHT + DTSTART:19870405T020000 + RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU;UNTIL=20060402T070000Z + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + BEGIN:DAYLIGHT + DTSTART:20070311T020000 + RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + BEGIN:STANDARD + DTSTART:20071104T020000 + RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + END:VTIMEZONE + + This is an example showing time zone information for New York City + using only the "DTSTART" property. Note that this is only + suitable for a recurring event that starts on or later than March + 11, 2007 at 03:00:00 EDT (i.e., the earliest effective transition + date and time) and ends no later than March 9, 2008 at 01:59:59 + + + +Desruisseaux Standards Track [Page 68] + +RFC 5545 iCalendar September 2009 + + + EST (i.e., latest valid date and time for EST in this scenario). + For example, this can be used for a recurring event that occurs + every Friday, 8:00 A.M.-9:00 A.M., starting June 1, 2007, ending + December 31, 2007, + + BEGIN:VTIMEZONE + TZID:America/New_York + LAST-MODIFIED:20050809T050000Z + BEGIN:STANDARD + DTSTART:20071104T020000 + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + BEGIN:DAYLIGHT + DTSTART:20070311T020000 + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + END:VTIMEZONE + + This is a simple example showing the current time zone rules for + New York City using a "RRULE" recurrence pattern. Note that there + is no effective end date to either of the Standard Time or + Daylight Time rules. This information would be valid for a + recurring event starting today and continuing indefinitely. + + BEGIN:VTIMEZONE + TZID:America/New_York + LAST-MODIFIED:20050809T050000Z + TZURL:http://zones.example.com/tz/America-New_York.ics + BEGIN:STANDARD + DTSTART:20071104T020000 + RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + BEGIN:DAYLIGHT + DTSTART:20070311T020000 + RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + END:VTIMEZONE + + + + +Desruisseaux Standards Track [Page 69] + +RFC 5545 iCalendar September 2009 + + + This is an example showing a set of rules for a fictitious time + zone where the Daylight Time rule has an effective end date (i.e., + after that date, Daylight Time is no longer observed). + + BEGIN:VTIMEZONE + TZID:Fictitious + LAST-MODIFIED:19870101T000000Z + BEGIN:STANDARD + DTSTART:19671029T020000 + RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + BEGIN:DAYLIGHT + DTSTART:19870405T020000 + RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4;UNTIL=19980404T070000Z + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + END:VTIMEZONE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 70] + +RFC 5545 iCalendar September 2009 + + + This is an example showing a set of rules for a fictitious time + zone where the first Daylight Time rule has an effective end date. + There is a second Daylight Time rule that picks up where the other + left off. + + BEGIN:VTIMEZONE + TZID:Fictitious + LAST-MODIFIED:19870101T000000Z + BEGIN:STANDARD + DTSTART:19671029T020000 + RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + BEGIN:DAYLIGHT + DTSTART:19870405T020000 + RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4;UNTIL=19980404T070000Z + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + BEGIN:DAYLIGHT + DTSTART:19990424T020000 + RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=4 + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + TZNAME:EDT + END:DAYLIGHT + END:VTIMEZONE + +3.6.6. Alarm Component + + Component Name: VALARM + + Purpose: Provide a grouping of component properties that define an + alarm. + + Format Definition: A "VALARM" calendar component is defined by the + following notation: + + alarmc = "BEGIN" ":" "VALARM" CRLF + (audioprop / dispprop / emailprop) + "END" ":" "VALARM" CRLF + + audioprop = *( + ; + ; 'action' and 'trigger' are both REQUIRED, + + + +Desruisseaux Standards Track [Page 71] + +RFC 5545 iCalendar September 2009 + + + ; but MUST NOT occur more than once. + ; + action / trigger / + ; + ; 'duration' and 'repeat' are both OPTIONAL, + ; and MUST NOT occur more than once each; + ; but if one occurs, so MUST the other. + ; + duration / repeat / + ; + ; The following is OPTIONAL, + ; but MUST NOT occur more than once. + ; + attach / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + x-prop / iana-prop + ; + ) + + dispprop = *( + ; + ; The following are REQUIRED, + ; but MUST NOT occur more than once. + ; + action / description / trigger / + ; + ; 'duration' and 'repeat' are both OPTIONAL, + ; and MUST NOT occur more than once each; + ; but if one occurs, so MUST the other. + ; + duration / repeat / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + x-prop / iana-prop + ; + ) + + emailprop = *( + ; + ; The following are all REQUIRED, + ; but MUST NOT occur more than once. + ; + action / description / trigger / summary / + + + +Desruisseaux Standards Track [Page 72] + +RFC 5545 iCalendar September 2009 + + + ; + ; The following is REQUIRED, + ; and MAY occur more than once. + ; + attendee / + ; + ; 'duration' and 'repeat' are both OPTIONAL, + ; and MUST NOT occur more than once each; + ; but if one occurs, so MUST the other. + ; + duration / repeat / + ; + ; The following are OPTIONAL, + ; and MAY occur more than once. + ; + attach / x-prop / iana-prop + ; + ) + + Description: A "VALARM" calendar component is a grouping of + component properties that is a reminder or alarm for an event or a + to-do. For example, it may be used to define a reminder for a + pending event or an overdue to-do. + + The "VALARM" calendar component MUST include the "ACTION" and + "TRIGGER" properties. The "ACTION" property further constrains + the "VALARM" calendar component in the following ways: + + When the action is "AUDIO", the alarm can also include one and + only one "ATTACH" property, which MUST point to a sound resource, + which is rendered when the alarm is triggered. + + When the action is "DISPLAY", the alarm MUST also include a + "DESCRIPTION" property, which contains the text to be displayed + when the alarm is triggered. + + When the action is "EMAIL", the alarm MUST include a "DESCRIPTION" + property, which contains the text to be used as the message body, + a "SUMMARY" property, which contains the text to be used as the + message subject, and one or more "ATTENDEE" properties, which + contain the email address of attendees to receive the message. It + can also include one or more "ATTACH" properties, which are + intended to be sent as message attachments. When the alarm is + triggered, the email message is sent. + + The "VALARM" calendar component MUST only appear within either a + "VEVENT" or "VTODO" calendar component. "VALARM" calendar + components cannot be nested. Multiple mutually independent + + + +Desruisseaux Standards Track [Page 73] + +RFC 5545 iCalendar September 2009 + + + "VALARM" calendar components can be specified for a single + "VEVENT" or "VTODO" calendar component. + + The "TRIGGER" property specifies when the alarm will be triggered. + The "TRIGGER" property specifies a duration prior to the start of + an event or a to-do. The "TRIGGER" edge may be explicitly set to + be relative to the "START" or "END" of the event or to-do with the + "RELATED" parameter of the "TRIGGER" property. The "TRIGGER" + property value type can alternatively be set to an absolute + calendar date with UTC time. + + In an alarm set to trigger on the "START" of an event or to-do, + the "DTSTART" property MUST be present in the associated event or + to-do. In an alarm in a "VEVENT" calendar component set to + trigger on the "END" of the event, either the "DTEND" property + MUST be present, or the "DTSTART" and "DURATION" properties MUST + both be present. In an alarm in a "VTODO" calendar component set + to trigger on the "END" of the to-do, either the "DUE" property + MUST be present, or the "DTSTART" and "DURATION" properties MUST + both be present. + + The alarm can be defined such that it triggers repeatedly. A + definition of an alarm with a repeating trigger MUST include both + the "DURATION" and "REPEAT" properties. The "DURATION" property + specifies the delay period, after which the alarm will repeat. + The "REPEAT" property specifies the number of additional + repetitions that the alarm will be triggered. This repetition + count is in addition to the initial triggering of the alarm. Both + of these properties MUST be present in order to specify a + repeating alarm. If one of these two properties is absent, then + the alarm will not repeat beyond the initial trigger. + + The "ACTION" property is used within the "VALARM" calendar + component to specify the type of action invoked when the alarm is + triggered. The "VALARM" properties provide enough information for + a specific action to be invoked. It is typically the + responsibility of a "Calendar User Agent" (CUA) to deliver the + alarm in the specified fashion. An "ACTION" property value of + AUDIO specifies an alarm that causes a sound to be played to alert + the user; DISPLAY specifies an alarm that causes a text message to + be displayed to the user; and EMAIL specifies an alarm that causes + an electronic email message to be delivered to one or more email + addresses. + + In an AUDIO alarm, if the optional "ATTACH" property is included, + it MUST specify an audio sound resource. The intention is that + the sound will be played as the alarm effect. If an "ATTACH" + property is specified that does not refer to a sound resource, or + + + +Desruisseaux Standards Track [Page 74] + +RFC 5545 iCalendar September 2009 + + + if the specified sound resource cannot be rendered (because its + format is unsupported, or because it cannot be retrieved), then + the CUA or other entity responsible for playing the sound may + choose a fallback action, such as playing a built-in default + sound, or playing no sound at all. + + In a DISPLAY alarm, the intended alarm effect is for the text + value of the "DESCRIPTION" property to be displayed to the user. + + In an EMAIL alarm, the intended alarm effect is for an email + message to be composed and delivered to all the addresses + specified by the "ATTENDEE" properties in the "VALARM" calendar + component. The "DESCRIPTION" property of the "VALARM" calendar + component MUST be used as the body text of the message, and the + "SUMMARY" property MUST be used as the subject text. Any "ATTACH" + properties in the "VALARM" calendar component SHOULD be sent as + attachments to the message. + + Note: Implementations should carefully consider whether they + accept alarm components from untrusted sources, e.g., when + importing calendar objects from external sources. One + reasonable policy is to always ignore alarm components that the + calendar user has not set herself, or at least ask for + confirmation in such a case. + + Example: The following example is for a "VALARM" calendar component + that specifies an audio alarm that will sound at a precise time + and repeat 4 more times at 15-minute intervals: + + BEGIN:VALARM + TRIGGER;VALUE=DATE-TIME:19970317T133000Z + REPEAT:4 + DURATION:PT15M + ACTION:AUDIO + ATTACH;FMTTYPE=audio/basic:ftp://example.com/pub/ + sounds/bell-01.aud + END:VALARM + + The following example is for a "VALARM" calendar component that + specifies a display alarm that will trigger 30 minutes before the + scheduled start of the event or of the to-do it is associated with + and will repeat 2 more times at 15-minute intervals: + + + + + + + + + +Desruisseaux Standards Track [Page 75] + +RFC 5545 iCalendar September 2009 + + + BEGIN:VALARM + TRIGGER:-PT30M + REPEAT:2 + DURATION:PT15M + ACTION:DISPLAY + DESCRIPTION:Breakfast meeting with executive\n + team at 8:30 AM EST. + END:VALARM + + The following example is for a "VALARM" calendar component that + specifies an email alarm that will trigger 2 days before the + scheduled due DATE-TIME of a to-do with which it is associated. + It does not repeat. The email has a subject, body, and attachment + link. + + BEGIN:VALARM + TRIGGER;RELATED=END:-P2D + ACTION:EMAIL + ATTENDEE:mailto:john_doe@example.com + SUMMARY:*** REMINDER: SEND AGENDA FOR WEEKLY STAFF MEETING *** + DESCRIPTION:A draft agenda needs to be sent out to the attendees + to the weekly managers meeting (MGR-LIST). Attached is a + pointer the document template for the agenda file. + ATTACH;FMTTYPE=application/msword:http://example.com/ + templates/agenda.doc + END:VALARM + +3.7. Calendar Properties + + The Calendar Properties are attributes that apply to the iCalendar + object, as a whole. These properties do not appear within a calendar + component. They SHOULD be specified after the "BEGIN:VCALENDAR" + delimiter string and prior to any calendar component. + +3.7.1. Calendar Scale + + Property Name: CALSCALE + + Purpose: This property defines the calendar scale used for the + calendar information specified in the iCalendar object. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified once in an iCalendar + object. The default value is "GREGORIAN". + + + +Desruisseaux Standards Track [Page 76] + +RFC 5545 iCalendar September 2009 + + + Description: This memo is based on the Gregorian calendar scale. + The Gregorian calendar scale is assumed if this property is not + specified in the iCalendar object. It is expected that other + calendar scales will be defined in other specifications or by + future versions of this memo. + + Format Definition: This property is defined by the following + notation: + + calscale = "CALSCALE" calparam ":" calvalue CRLF + + calparam = *(";" other-param) + + calvalue = "GREGORIAN" + + Example: The following is an example of this property: + + CALSCALE:GREGORIAN + +3.7.2. Method + + Property Name: METHOD + + Purpose: This property defines the iCalendar object method + associated with the calendar object. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified once in an iCalendar + object. + + Description: When used in a MIME message entity, the value of this + property MUST be the same as the Content-Type "method" parameter + value. If either the "METHOD" property or the Content-Type + "method" parameter is specified, then the other MUST also be + specified. + + No methods are defined by this specification. This is the subject + of other specifications, such as the iCalendar Transport- + independent Interoperability Protocol (iTIP) defined by [2446bis]. + + If this property is not present in the iCalendar object, then a + scheduling transaction MUST NOT be assumed. In such cases, the + iCalendar object is merely being used to transport a snapshot of + + + + +Desruisseaux Standards Track [Page 77] + +RFC 5545 iCalendar September 2009 + + + some calendar information; without the intention of conveying a + scheduling semantic. + + Format Definition: This property is defined by the following + notation: + + method = "METHOD" metparam ":" metvalue CRLF + + metparam = *(";" other-param) + + metvalue = iana-token + + Example: The following is a hypothetical example of this property to + convey that the iCalendar object is a scheduling request: + + METHOD:REQUEST + +3.7.3. Product Identifier + + Property Name: PRODID + + Purpose: This property specifies the identifier for the product that + created the iCalendar object. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: The property MUST be specified once in an iCalendar + object. + + Description: The vendor of the implementation SHOULD assure that + this is a globally unique identifier; using some technique such as + an FPI value, as defined in [ISO.9070.1991]. + + This property SHOULD NOT be used to alter the interpretation of an + iCalendar object beyond the semantics specified in this memo. For + example, it is not to be used to further the understanding of non- + standard properties. + + Format Definition: This property is defined by the following + notation: + + prodid = "PRODID" pidparam ":" pidvalue CRLF + + pidparam = *(";" other-param) + + + + +Desruisseaux Standards Track [Page 78] + +RFC 5545 iCalendar September 2009 + + + pidvalue = text + ;Any text that describes the product and version + ;and that is generally assured of being unique. + + Example: The following is an example of this property. It does not + imply that English is the default language. + + PRODID:-//ABC Corporation//NONSGML My Product//EN + +3.7.4. Version + + Property Name: VERSION + + Purpose: This property specifies the identifier corresponding to the + highest version number or the minimum and maximum range of the + iCalendar specification that is required in order to interpret the + iCalendar object. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property MUST be specified once in an iCalendar + object. + + Description: A value of "2.0" corresponds to this memo. + + Format Definition: This property is defined by the following + notation: + + version = "VERSION" verparam ":" vervalue CRLF + + verparam = *(";" other-param) + + vervalue = "2.0" ;This memo + / maxver + / (minver ";" maxver) + + minver =
+ ;Minimum iCalendar version needed to parse the iCalendar object. + + maxver = + ;Maximum iCalendar version needed to parse the iCalendar object. + + + + + + + +Desruisseaux Standards Track [Page 79] + +RFC 5545 iCalendar September 2009 + + + Example: The following is an example of this property: + + VERSION:2.0 + +3.8. Component Properties + + The following properties can appear within calendar components, as + specified by each component property definition. + +3.8.1. Descriptive Component Properties + + The following properties specify descriptive information about + calendar components. + +3.8.1.1. Attachment + + Property Name: ATTACH + + Purpose: This property provides the capability to associate a + document object with a calendar component. + + Value Type: The default value type for this property is URI. The + value type can also be set to BINARY to indicate inline binary + encoded content information. + + Property Parameters: IANA, non-standard, inline encoding, and value + data type property parameters can be specified on this property. + The format type parameter can be specified on this property and is + RECOMMENDED for inline binary encoded content information. + + Conformance: This property can be specified multiple times in a + "VEVENT", "VTODO", "VJOURNAL", or "VALARM" calendar component with + the exception of AUDIO alarm that only allows this property to + occur once. + + Description: This property is used in "VEVENT", "VTODO", and + "VJOURNAL" calendar components to associate a resource (e.g., + document) with the calendar component. This property is used in + "VALARM" calendar components to specify an audio sound resource or + an email message attachment. This property can be specified as a + URI pointing to a resource or as inline binary encoded content. + + When this property is specified as inline binary encoded content, + calendar applications MAY attempt to guess the media type of the + resource via inspection of its content if and only if the media + type of the resource is not given by the "FMTTYPE" parameter. If + the media type remains unknown, calendar applications SHOULD treat + it as type "application/octet-stream". + + + +Desruisseaux Standards Track [Page 80] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + attach = "ATTACH" attachparam ( ":" uri ) / + ( + ";" "ENCODING" "=" "BASE64" + ";" "VALUE" "=" "BINARY" + ":" binary + ) + CRLF + + attachparam = *( + ; + ; The following is OPTIONAL for a URI value, + ; RECOMMENDED for a BINARY value, + ; and MUST NOT occur more than once. + ; + (";" fmttypeparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following are examples of this property: + + ATTACH:CID:jsmith.part3.960817T083000.xyzMail@example.com + + ATTACH;FMTTYPE=application/postscript:ftp://example.com/pub/ + reports/r-960812.ps + +3.8.1.2. Categories + + Property Name: CATEGORIES + + Purpose: This property defines the categories for a calendar + component. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, and language property + parameters can be specified on this property. + + Conformance: The property can be specified within "VEVENT", "VTODO", + or "VJOURNAL" calendar components. + + + + +Desruisseaux Standards Track [Page 81] + +RFC 5545 iCalendar September 2009 + + + Description: This property is used to specify categories or subtypes + of the calendar component. The categories are useful in searching + for a calendar component of a particular type and category. + Within the "VEVENT", "VTODO", or "VJOURNAL" calendar components, + more than one category can be specified as a COMMA-separated list + of categories. + + Format Definition: This property is defined by the following + notation: + + categories = "CATEGORIES" catparam ":" text *("," text) + CRLF + + catparam = *( + ; + ; The following is OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" languageparam ) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following are examples of this property: + + CATEGORIES:APPOINTMENT,EDUCATION + + CATEGORIES:MEETING + +3.8.1.3. Classification + + Property Name: CLASS + + Purpose: This property defines the access classification for a + calendar component. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: The property can be specified once in a "VEVENT", + "VTODO", or "VJOURNAL" calendar components. + + + + +Desruisseaux Standards Track [Page 82] + +RFC 5545 iCalendar September 2009 + + + Description: An access classification is only one component of the + general security system within a calendar application. It + provides a method of capturing the scope of the access the + calendar owner intends for information within an individual + calendar entry. The access classification of an individual + iCalendar component is useful when measured along with the other + security components of a calendar system (e.g., calendar user + authentication, authorization, access rights, access role, etc.). + Hence, the semantics of the individual access classifications + cannot be completely defined by this memo alone. Additionally, + due to the "blind" nature of most exchange processes using this + memo, these access classifications cannot serve as an enforcement + statement for a system receiving an iCalendar object. Rather, + they provide a method for capturing the intention of the calendar + owner for the access to the calendar component. If not specified + in a component that allows this property, the default value is + PUBLIC. Applications MUST treat x-name and iana-token values they + don't recognize the same way as they would the PRIVATE value. + + Format Definition: This property is defined by the following + notation: + + class = "CLASS" classparam ":" classvalue CRLF + + classparam = *(";" other-param) + + classvalue = "PUBLIC" / "PRIVATE" / "CONFIDENTIAL" / iana-token + / x-name + ;Default is PUBLIC + + Example: The following is an example of this property: + + CLASS:PUBLIC + +3.8.1.4. Comment + + Property Name: COMMENT + + Purpose: This property specifies non-processing information intended + to provide a comment to the calendar user. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, alternate text + representation, and language property parameters can be specified + on this property. + + + + + +Desruisseaux Standards Track [Page 83] + +RFC 5545 iCalendar September 2009 + + + Conformance: This property can be specified multiple times in + "VEVENT", "VTODO", "VJOURNAL", and "VFREEBUSY" calendar components + as well as in the "STANDARD" and "DAYLIGHT" sub-components. + + Description: This property is used to specify a comment to the + calendar user. + + Format Definition: This property is defined by the following + notation: + + comment = "COMMENT" commparam ":" text CRLF + + commparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property: + + COMMENT:The meeting really needs to include both ourselves + and the customer. We can't hold this meeting without them. + As a matter of fact\, the venue for the meeting ought to be at + their site. - - John + +3.8.1.5. Description + + Property Name: DESCRIPTION + + Purpose: This property provides a more complete description of the + calendar component than that provided by the "SUMMARY" property. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, alternate text + representation, and language property parameters can be specified + on this property. + + + + + + +Desruisseaux Standards Track [Page 84] + +RFC 5545 iCalendar September 2009 + + + Conformance: The property can be specified in the "VEVENT", "VTODO", + "VJOURNAL", or "VALARM" calendar components. The property can be + specified multiple times only within a "VJOURNAL" calendar + component. + + Description: This property is used in the "VEVENT" and "VTODO" to + capture lengthy textual descriptions associated with the activity. + + This property is used in the "VJOURNAL" calendar component to + capture one or more textual journal entries. + + This property is used in the "VALARM" calendar component to + capture the display text for a DISPLAY category of alarm, and to + capture the body text for an EMAIL category of alarm. + + Format Definition: This property is defined by the following + notation: + + description = "DESCRIPTION" descparam ":" text CRLF + + descparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property with formatted + line breaks in the property value: + + DESCRIPTION:Meeting to provide technical review for "Phoenix" + design.\nHappy Face Conference Room. Phoenix design team + MUST attend this meeting.\nRSVP to team leader. + +3.8.1.6. Geographic Position + + Property Name: GEO + + Purpose: This property specifies information related to the global + position for the activity specified by a calendar component. + + + + +Desruisseaux Standards Track [Page 85] + +RFC 5545 iCalendar September 2009 + + + Value Type: FLOAT. The value MUST be two SEMICOLON-separated FLOAT + values. + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in "VEVENT" or "VTODO" + calendar components. + + Description: This property value specifies latitude and longitude, + in that order (i.e., "LAT LON" ordering). The longitude + represents the location east or west of the prime meridian as a + positive or negative real number, respectively. The longitude and + latitude values MAY be specified up to six decimal places, which + will allow for accuracy to within one meter of geographical + position. Receiving applications MUST accept values of this + precision and MAY truncate values of greater precision. + + Values for latitude and longitude shall be expressed as decimal + fractions of degrees. Whole degrees of latitude shall be + represented by a two-digit decimal number ranging from 0 through + 90. Whole degrees of longitude shall be represented by a decimal + number ranging from 0 through 180. When a decimal fraction of a + degree is specified, it shall be separated from the whole number + of degrees by a decimal point. + + Latitudes north of the equator shall be specified by a plus sign + (+), or by the absence of a minus sign (-), preceding the digits + designating degrees. Latitudes south of the Equator shall be + designated by a minus sign (-) preceding the digits designating + degrees. A point on the Equator shall be assigned to the Northern + Hemisphere. + + Longitudes east of the prime meridian shall be specified by a plus + sign (+), or by the absence of a minus sign (-), preceding the + digits designating degrees. Longitudes west of the meridian shall + be designated by minus sign (-) preceding the digits designating + degrees. A point on the prime meridian shall be assigned to the + Eastern Hemisphere. A point on the 180th meridian shall be + assigned to the Western Hemisphere. One exception to this last + convention is permitted. For the special condition of describing + a band of latitude around the earth, the East Bounding Coordinate + data element shall be assigned the value +180 (180) degrees. + + Any spatial address with a latitude of +90 (90) or -90 degrees + will specify the position at the North or South Pole, + respectively. The component for longitude may have any legal + value. + + + +Desruisseaux Standards Track [Page 86] + +RFC 5545 iCalendar September 2009 + + + With the exception of the special condition described above, this + form is specified in [ANSI INCITS 61-1986]. + + The simple formula for converting degrees-minutes-seconds into + decimal degrees is: + + decimal = degrees + minutes/60 + seconds/3600. + + Format Definition: This property is defined by the following + notation: + + geo = "GEO" geoparam ":" geovalue CRLF + + geoparam = *(";" other-param) + + geovalue = float ";" float + ;Latitude and Longitude components + + Example: The following is an example of this property: + + GEO:37.386013;-122.082932 + +3.8.1.7. Location + + Property Name: LOCATION + + Purpose: This property defines the intended venue for the activity + defined by a calendar component. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, alternate text + representation, and language property parameters can be specified + on this property. + + Conformance: This property can be specified in "VEVENT" or "VTODO" + calendar component. + + Description: Specific venues such as conference or meeting rooms may + be explicitly specified using this property. An alternate + representation may be specified that is a URI that points to + directory information with more structured specification of the + location. For example, the alternate representation may specify + either an LDAP URL [RFC4516] pointing to an LDAP server entry or a + CID URL [RFC2392] pointing to a MIME body part containing a + Virtual-Information Card (vCard) [RFC2426] for the location. + + + + + +Desruisseaux Standards Track [Page 87] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + location = "LOCATION" locparam ":" text CRLF + + locparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following are some examples of this property: + + LOCATION:Conference Room - F123\, Bldg. 002 + + LOCATION;ALTREP="http://xyzcorp.com/conf-rooms/f123.vcf": + Conference Room - F123\, Bldg. 002 + +3.8.1.8. Percent Complete + + Property Name: PERCENT-COMPLETE + + Purpose: This property is used by an assignee or delegatee of a + to-do to convey the percent completion of a to-do to the + "Organizer". + + Value Type: INTEGER + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified once in a "VTODO" + calendar component. + + Description: The property value is a positive integer between 0 and + 100. A value of "0" indicates the to-do has not yet been started. + A value of "100" indicates that the to-do has been completed. + Integer values in between indicate the percent partially complete. + + + + + +Desruisseaux Standards Track [Page 88] + +RFC 5545 iCalendar September 2009 + + + When a to-do is assigned to multiple individuals, the property + value indicates the percent complete for that portion of the to-do + assigned to the assignee or delegatee. For example, if a to-do is + assigned to both individuals "A" and "B". A reply from "A" with a + percent complete of "70" indicates that "A" has completed 70% of + the to-do assigned to them. A reply from "B" with a percent + complete of "50" indicates "B" has completed 50% of the to-do + assigned to them. + + Format Definition: This property is defined by the following + notation: + + percent = "PERCENT-COMPLETE" pctparam ":" integer CRLF + + pctparam = *(";" other-param) + + Example: The following is an example of this property to show 39% + completion: + + PERCENT-COMPLETE:39 + +3.8.1.9. Priority + + Property Name: PRIORITY + + Purpose: This property defines the relative priority for a calendar + component. + + Value Type: INTEGER + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in "VEVENT" and "VTODO" + calendar components. + + Description: This priority is specified as an integer in the range 0 + to 9. A value of 0 specifies an undefined priority. A value of 1 + is the highest priority. A value of 2 is the second highest + priority. Subsequent numbers specify a decreasing ordinal + priority. A value of 9 is the lowest priority. + + A CUA with a three-level priority scheme of "HIGH", "MEDIUM", and + "LOW" is mapped into this property such that a property value in + the range of 1 to 4 specifies "HIGH" priority. A value of 5 is + the normal or "MEDIUM" priority. A value in the range of 6 to 9 + is "LOW" priority. + + + + +Desruisseaux Standards Track [Page 89] + +RFC 5545 iCalendar September 2009 + + + A CUA with a priority schema of "A1", "A2", "A3", "B1", "B2", ..., + "C3" is mapped into this property such that a property value of 1 + specifies "A1", a property value of 2 specifies "A2", a property + value of 3 specifies "A3", and so forth up to a property value of + 9 specifies "C3". + + Other integer values are reserved for future use. + + Within a "VEVENT" calendar component, this property specifies a + priority for the event. This property may be useful when more + than one event is scheduled for a given time period. + + Within a "VTODO" calendar component, this property specified a + priority for the to-do. This property is useful in prioritizing + multiple action items for a given time period. + + Format Definition: This property is defined by the following + notation: + + priority = "PRIORITY" prioparam ":" priovalue CRLF + ;Default is zero (i.e., undefined). + + prioparam = *(";" other-param) + + priovalue = integer ;Must be in the range [0..9] + ; All other values are reserved for future use. + + Example: The following is an example of a property with the highest + priority: + + PRIORITY:1 + + The following is an example of a property with a next highest + priority: + + PRIORITY:2 + + The following is an example of a property with no priority. This + is equivalent to not specifying the "PRIORITY" property: + + PRIORITY:0 + + + + + + + + + + +Desruisseaux Standards Track [Page 90] + +RFC 5545 iCalendar September 2009 + + +3.8.1.10. Resources + + Property Name: RESOURCES + + Purpose: This property defines the equipment or resources + anticipated for an activity specified by a calendar component. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, alternate text + representation, and language property parameters can be specified + on this property. + + Conformance: This property can be specified once in "VEVENT" or + "VTODO" calendar component. + + Description: The property value is an arbitrary text. More than one + resource can be specified as a COMMA-separated list of resources. + + Format Definition: This property is defined by the following + notation: + + resources = "RESOURCES" resrcparam ":" text *("," text) CRLF + + resrcparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property: + + RESOURCES:EASEL,PROJECTOR,VCR + + RESOURCES;LANGUAGE=fr:Nettoyeur haute pression + + + + + + + + +Desruisseaux Standards Track [Page 91] + +RFC 5545 iCalendar September 2009 + + +3.8.1.11. Status + + Property Name: STATUS + + Purpose: This property defines the overall status or confirmation + for the calendar component. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified once in "VEVENT", + "VTODO", or "VJOURNAL" calendar components. + + Description: In a group-scheduled calendar component, the property + is used by the "Organizer" to provide a confirmation of the event + to the "Attendees". For example in a "VEVENT" calendar component, + the "Organizer" can indicate that a meeting is tentative, + confirmed, or cancelled. In a "VTODO" calendar component, the + "Organizer" can indicate that an action item needs action, is + completed, is in process or being worked on, or has been + cancelled. In a "VJOURNAL" calendar component, the "Organizer" + can indicate that a journal entry is draft, final, or has been + cancelled or removed. + + Format Definition: This property is defined by the following + notation: + + status = "STATUS" statparam ":" statvalue CRLF + + statparam = *(";" other-param) + + statvalue = (statvalue-event + / statvalue-todo + / statvalue-jour) + + statvalue-event = "TENTATIVE" ;Indicates event is tentative. + / "CONFIRMED" ;Indicates event is definite. + / "CANCELLED" ;Indicates event was cancelled. + ;Status values for a "VEVENT" + + statvalue-todo = "NEEDS-ACTION" ;Indicates to-do needs action. + / "COMPLETED" ;Indicates to-do completed. + / "IN-PROCESS" ;Indicates to-do in process of. + / "CANCELLED" ;Indicates to-do was cancelled. + ;Status values for "VTODO". + + + + +Desruisseaux Standards Track [Page 92] + +RFC 5545 iCalendar September 2009 + + + statvalue-jour = "DRAFT" ;Indicates journal is draft. + / "FINAL" ;Indicates journal is final. + / "CANCELLED" ;Indicates journal is removed. + ;Status values for "VJOURNAL". + + Example: The following is an example of this property for a "VEVENT" + calendar component: + + STATUS:TENTATIVE + + The following is an example of this property for a "VTODO" + calendar component: + + STATUS:NEEDS-ACTION + + The following is an example of this property for a "VJOURNAL" + calendar component: + + STATUS:DRAFT + +3.8.1.12. Summary + + Property Name: SUMMARY + + Purpose: This property defines a short summary or subject for the + calendar component. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, alternate text + representation, and language property parameters can be specified + on this property. + + Conformance: The property can be specified in "VEVENT", "VTODO", + "VJOURNAL", or "VALARM" calendar components. + + Description: This property is used in the "VEVENT", "VTODO", and + "VJOURNAL" calendar components to capture a short, one-line + summary about the activity or journal entry. + + This property is used in the "VALARM" calendar component to + capture the subject of an EMAIL category of alarm. + + Format Definition: This property is defined by the following + notation: + + + + + + +Desruisseaux Standards Track [Page 93] + +RFC 5545 iCalendar September 2009 + + + summary = "SUMMARY" summparam ":" text CRLF + + summparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property: + + SUMMARY:Department Party + +3.8.2. Date and Time Component Properties + + The following properties specify date and time related information in + calendar components. + +3.8.2.1. Date-Time Completed + + Property Name: COMPLETED + + Purpose: This property defines the date and time that a to-do was + actually completed. + + Value Type: DATE-TIME + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: The property can be specified in a "VTODO" calendar + component. The value MUST be specified as a date with UTC time. + + Description: This property defines the date and time that a to-do + was actually completed. + + Format Definition: This property is defined by the following + notation: + + + + + + +Desruisseaux Standards Track [Page 94] + +RFC 5545 iCalendar September 2009 + + + completed = "COMPLETED" compparam ":" date-time CRLF + + compparam = *(";" other-param) + + Example: The following is an example of this property: + + COMPLETED:19960401T150000Z + +3.8.2.2. Date-Time End + + Property Name: DTEND + + Purpose: This property specifies the date and time that a calendar + component ends. + + Value Type: The default value type is DATE-TIME. The value type can + be set to a DATE value type. + + Property Parameters: IANA, non-standard, value data type, and time + zone identifier property parameters can be specified on this + property. + + Conformance: This property can be specified in "VEVENT" or + "VFREEBUSY" calendar components. + + Description: Within the "VEVENT" calendar component, this property + defines the date and time by which the event ends. The value type + of this property MUST be the same as the "DTSTART" property, and + its value MUST be later in time than the value of the "DTSTART" + property. Furthermore, this property MUST be specified as a date + with local time if and only if the "DTSTART" property is also + specified as a date with local time. + + Within the "VFREEBUSY" calendar component, this property defines + the end date and time for the free or busy time information. The + time MUST be specified in the UTC time format. The value MUST be + later in time than the value of the "DTSTART" property. + + Format Definition: This property is defined by the following + notation: + + + + + + + + + + + +Desruisseaux Standards Track [Page 95] + +RFC 5545 iCalendar September 2009 + + + dtend = "DTEND" dtendparam ":" dtendval CRLF + + dtendparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("DATE-TIME" / "DATE")) / + (";" tzidparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + dtendval = date-time / date + ;Value MUST match value type + + Example: The following is an example of this property: + + DTEND:19960401T150000Z + + DTEND;VALUE=DATE:19980704 + +3.8.2.3. Date-Time Due + + Property Name: DUE + + Purpose: This property defines the date and time that a to-do is + expected to be completed. + + Value Type: The default value type is DATE-TIME. The value type can + be set to a DATE value type. + + Property Parameters: IANA, non-standard, value data type, and time + zone identifier property parameters can be specified on this + property. + + Conformance: The property can be specified once in a "VTODO" + calendar component. + + Description: This property defines the date and time before which a + to-do is expected to be completed. For cases where this property + is specified in a "VTODO" calendar component that also specifies a + "DTSTART" property, the value type of this property MUST be the + same as the "DTSTART" property, and the value of this property + + + +Desruisseaux Standards Track [Page 96] + +RFC 5545 iCalendar September 2009 + + + MUST be later in time than the value of the "DTSTART" property. + Furthermore, this property MUST be specified as a date with local + time if and only if the "DTSTART" property is also specified as a + date with local time. + + Format Definition: This property is defined by the following + notation: + + due = "DUE" dueparam ":" dueval CRLF + + dueparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("DATE-TIME" / "DATE")) / + (";" tzidparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + dueval = date-time / date + ;Value MUST match value type + + Example: The following is an example of this property: + + DUE:19980430T000000Z + +3.8.2.4. Date-Time Start + + Property Name: DTSTART + + Purpose: This property specifies when the calendar component begins. + + Value Type: The default value type is DATE-TIME. The time value + MUST be one of the forms defined for the DATE-TIME value type. + The value type can be set to a DATE value type. + + Property Parameters: IANA, non-standard, value data type, and time + zone identifier property parameters can be specified on this + property. + + Conformance: This property can be specified once in the "VEVENT", + "VTODO", or "VFREEBUSY" calendar components as well as in the + + + +Desruisseaux Standards Track [Page 97] + +RFC 5545 iCalendar September 2009 + + + "STANDARD" and "DAYLIGHT" sub-components. This property is + REQUIRED in all types of recurring calendar components that + specify the "RRULE" property. This property is also REQUIRED in + "VEVENT" calendar components contained in iCalendar objects that + don't specify the "METHOD" property. + + Description: Within the "VEVENT" calendar component, this property + defines the start date and time for the event. + + Within the "VFREEBUSY" calendar component, this property defines + the start date and time for the free or busy time information. + The time MUST be specified in UTC time. + + Within the "STANDARD" and "DAYLIGHT" sub-components, this property + defines the effective start date and time for a time zone + specification. This property is REQUIRED within each "STANDARD" + and "DAYLIGHT" sub-components included in "VTIMEZONE" calendar + components and MUST be specified as a date with local time without + the "TZID" property parameter. + + Format Definition: This property is defined by the following + notation: + + dtstart = "DTSTART" dtstparam ":" dtstval CRLF + + dtstparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("DATE-TIME" / "DATE")) / + (";" tzidparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + dtstval = date-time / date + ;Value MUST match value type + + Example: The following is an example of this property: + + DTSTART:19980118T073000Z + + + + + +Desruisseaux Standards Track [Page 98] + +RFC 5545 iCalendar September 2009 + + +3.8.2.5. Duration + + Property Name: DURATION + + Purpose: This property specifies a positive duration of time. + + Value Type: DURATION + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in "VEVENT", "VTODO", or + "VALARM" calendar components. + + Description: In a "VEVENT" calendar component the property may be + used to specify a duration of the event, instead of an explicit + end DATE-TIME. In a "VTODO" calendar component the property may + be used to specify a duration for the to-do, instead of an + explicit due DATE-TIME. In a "VALARM" calendar component the + property may be used to specify the delay period prior to + repeating an alarm. When the "DURATION" property relates to a + "DTSTART" property that is specified as a DATE value, then the + "DURATION" property MUST be specified as a "dur-day" or "dur-week" + value. + + Format Definition: This property is defined by the following + notation: + + duration = "DURATION" durparam ":" dur-value CRLF + ;consisting of a positive duration of time. + + durparam = *(";" other-param) + + Example: The following is an example of this property that specifies + an interval of time of one hour and zero minutes and zero seconds: + + DURATION:PT1H0M0S + + The following is an example of this property that specifies an + interval of time of 15 minutes. + + DURATION:PT15M + + + + + + + + + +Desruisseaux Standards Track [Page 99] + +RFC 5545 iCalendar September 2009 + + +3.8.2.6. Free/Busy Time + + Property Name: FREEBUSY + + Purpose: This property defines one or more free or busy time + intervals. + + Value Type: PERIOD + + Property Parameters: IANA, non-standard, and free/busy time type + property parameters can be specified on this property. + + Conformance: The property can be specified in a "VFREEBUSY" calendar + component. + + Description: These time periods can be specified as either a start + and end DATE-TIME or a start DATE-TIME and DURATION. The date and + time MUST be a UTC time format. + + "FREEBUSY" properties within the "VFREEBUSY" calendar component + SHOULD be sorted in ascending order, based on start time and then + end time, with the earliest periods first. + + The "FREEBUSY" property can specify more than one value, separated + by the COMMA character. In such cases, the "FREEBUSY" property + values MUST all be of the same "FBTYPE" property parameter type + (e.g., all values of a particular "FBTYPE" listed together in a + single property). + + Format Definition: This property is defined by the following + notation: + + freebusy = "FREEBUSY" fbparam ":" fbvalue CRLF + + fbparam = *( + ; + ; The following is OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" fbtypeparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + + + +Desruisseaux Standards Track [Page 100] + +RFC 5545 iCalendar September 2009 + + + fbvalue = period *("," period) + ;Time value MUST be in the UTC time format. + + Example: The following are some examples of this property: + + FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:19970308T160000Z/PT8H30M + + FREEBUSY;FBTYPE=FREE:19970308T160000Z/PT3H,19970308T200000Z/PT1H + + FREEBUSY;FBTYPE=FREE:19970308T160000Z/PT3H,19970308T200000Z/PT1H + ,19970308T230000Z/19970309T000000Z + +3.8.2.7. Time Transparency + + Property Name: TRANSP + + Purpose: This property defines whether or not an event is + transparent to busy time searches. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified once in a "VEVENT" + calendar component. + + Description: Time Transparency is the characteristic of an event + that determines whether it appears to consume time on a calendar. + Events that consume actual time for the individual or resource + associated with the calendar SHOULD be recorded as OPAQUE, + allowing them to be detected by free/busy time searches. Other + events, which do not take up the individual's (or resource's) time + SHOULD be recorded as TRANSPARENT, making them invisible to free/ + busy time searches. + + Format Definition: This property is defined by the following + notation: + + transp = "TRANSP" transparam ":" transvalue CRLF + + transparam = *(";" other-param) + + transvalue = "OPAQUE" + ;Blocks or opaque on busy time searches. + / "TRANSPARENT" + ;Transparent on busy time searches. + ;Default value is OPAQUE + + + +Desruisseaux Standards Track [Page 101] + +RFC 5545 iCalendar September 2009 + + + Example: The following is an example of this property for an event + that is transparent or does not block on free/busy time searches: + + TRANSP:TRANSPARENT + + The following is an example of this property for an event that is + opaque or blocks on free/busy time searches: + + TRANSP:OPAQUE + +3.8.3. Time Zone Component Properties + + The following properties specify time zone information in calendar + components. + +3.8.3.1. Time Zone Identifier + + Property Name: TZID + + Purpose: This property specifies the text value that uniquely + identifies the "VTIMEZONE" calendar component in the scope of an + iCalendar object. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property MUST be specified in a "VTIMEZONE" + calendar component. + + Description: This is the label by which a time zone calendar + component is referenced by any iCalendar properties whose value + type is either DATE-TIME or TIME and not intended to specify a UTC + or a "floating" time. The presence of the SOLIDUS character as a + prefix, indicates that this "TZID" represents an unique ID in a + globally defined time zone registry (when such registry is + defined). + + Note: This document does not define a naming convention for + time zone identifiers. Implementers may want to use the naming + conventions defined in existing time zone specifications such + as the public-domain TZ database [TZDB]. The specification of + globally unique time zone identifiers is not addressed by this + document and is left for future study. + + + + + + +Desruisseaux Standards Track [Page 102] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + tzid = "TZID" tzidpropparam ":" [tzidprefix] text CRLF + + tzidpropparam = *(";" other-param) + + ;tzidprefix = "/" + ; Defined previously. Just listed here for reader convenience. + + Example: The following are examples of non-globally unique time zone + identifiers: + + TZID:America/New_York + + TZID:America/Los_Angeles + + The following is an example of a fictitious globally unique time + zone identifier: + + TZID:/example.org/America/New_York + +3.8.3.2. Time Zone Name + + Property Name: TZNAME + + Purpose: This property specifies the customary designation for a + time zone description. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, and language property + parameters can be specified on this property. + + Conformance: This property can be specified in "STANDARD" and + "DAYLIGHT" sub-components. + + Description: This property specifies a customary name that can be + used when displaying dates that occur during the observance + defined by the time zone sub-component. + + Format Definition: This property is defined by the following + notation: + + + + + + + + +Desruisseaux Standards Track [Page 103] + +RFC 5545 iCalendar September 2009 + + + tzname = "TZNAME" tznparam ":" text CRLF + + tznparam = *( + ; + ; The following is OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following are examples of this property: + + TZNAME:EST + + TZNAME;LANGUAGE=fr-CA:HNE + +3.8.3.3. Time Zone Offset From + + Property Name: TZOFFSETFROM + + Purpose: This property specifies the offset that is in use prior to + this time zone observance. + + Value Type: UTC-OFFSET + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property MUST be specified in "STANDARD" and + "DAYLIGHT" sub-components. + + Description: This property specifies the offset that is in use prior + to this time observance. It is used to calculate the absolute + time at which the transition to a given observance takes place. + This property MUST only be specified in a "VTIMEZONE" calendar + component. A "VTIMEZONE" calendar component MUST include this + property. The property value is a signed numeric indicating the + number of hours and possibly minutes from UTC. Positive numbers + represent time zones east of the prime meridian, or ahead of UTC. + Negative numbers represent time zones west of the prime meridian, + or behind UTC. + + + + +Desruisseaux Standards Track [Page 104] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + tzoffsetfrom = "TZOFFSETFROM" frmparam ":" utc-offset + CRLF + + frmparam = *(";" other-param) + + Example: The following are examples of this property: + + TZOFFSETFROM:-0500 + + TZOFFSETFROM:+1345 + +3.8.3.4. Time Zone Offset To + + Property Name: TZOFFSETTO + + Purpose: This property specifies the offset that is in use in this + time zone observance. + + Value Type: UTC-OFFSET + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property MUST be specified in "STANDARD" and + "DAYLIGHT" sub-components. + + Description: This property specifies the offset that is in use in + this time zone observance. It is used to calculate the absolute + time for the new observance. The property value is a signed + numeric indicating the number of hours and possibly minutes from + UTC. Positive numbers represent time zones east of the prime + meridian, or ahead of UTC. Negative numbers represent time zones + west of the prime meridian, or behind UTC. + + Format Definition: This property is defined by the following + notation: + + tzoffsetto = "TZOFFSETTO" toparam ":" utc-offset CRLF + + toparam = *(";" other-param) + + + + + + + + +Desruisseaux Standards Track [Page 105] + +RFC 5545 iCalendar September 2009 + + + Example: The following are examples of this property: + + TZOFFSETTO:-0400 + + TZOFFSETTO:+1245 + +3.8.3.5. Time Zone URL + + Property Name: TZURL + + Purpose: This property provides a means for a "VTIMEZONE" component + to point to a network location that can be used to retrieve an up- + to-date version of itself. + + Value Type: URI + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in a "VTIMEZONE" + calendar component. + + Description: This property provides a means for a "VTIMEZONE" + component to point to a network location that can be used to + retrieve an up-to-date version of itself. This provides a hook to + handle changes government bodies impose upon time zone + definitions. Retrieval of this resource results in an iCalendar + object containing a single "VTIMEZONE" component and a "METHOD" + property set to PUBLISH. + + Format Definition: This property is defined by the following + notation: + + tzurl = "TZURL" tzurlparam ":" uri CRLF + + tzurlparam = *(";" other-param) + + Example: The following is an example of this property: + + TZURL:http://timezones.example.org/tz/America-Los_Angeles.ics + +3.8.4. Relationship Component Properties + + The following properties specify relationship information in calendar + components. + + + + + + +Desruisseaux Standards Track [Page 106] + +RFC 5545 iCalendar September 2009 + + +3.8.4.1. Attendee + + Property Name: ATTENDEE + + Purpose: This property defines an "Attendee" within a calendar + component. + + Value Type: CAL-ADDRESS + + Property Parameters: IANA, non-standard, language, calendar user + type, group or list membership, participation role, participation + status, RSVP expectation, delegatee, delegator, sent by, common + name, or directory entry reference property parameters can be + specified on this property. + + Conformance: This property MUST be specified in an iCalendar object + that specifies a group-scheduled calendar entity. This property + MUST NOT be specified in an iCalendar object when publishing the + calendar information (e.g., NOT in an iCalendar object that + specifies the publication of a calendar user's busy time, event, + to-do, or journal). This property is not specified in an + iCalendar object that specifies only a time zone definition or + that defines calendar components that are not group-scheduled + components, but are components only on a single user's calendar. + + Description: This property MUST only be specified within calendar + components to specify participants, non-participants, and the + chair of a group-scheduled calendar entity. The property is + specified within an "EMAIL" category of the "VALARM" calendar + component to specify an email address that is to receive the email + type of iCalendar alarm. + + The property parameter "CN" is for the common or displayable name + associated with the calendar address; "ROLE", for the intended + role that the attendee will have in the calendar component; + "PARTSTAT", for the status of the attendee's participation; + "RSVP", for indicating whether the favor of a reply is requested; + "CUTYPE", to indicate the type of calendar user; "MEMBER", to + indicate the groups that the attendee belongs to; "DELEGATED-TO", + to indicate the calendar users that the original request was + delegated to; and "DELEGATED-FROM", to indicate whom the request + was delegated from; "SENT-BY", to indicate whom is acting on + behalf of the "ATTENDEE"; and "DIR", to indicate the URI that + points to the directory information corresponding to the attendee. + These property parameters can be specified on an "ATTENDEE" + property in either a "VEVENT", "VTODO", or "VJOURNAL" calendar + component. They MUST NOT be specified in an "ATTENDEE" property + in a "VFREEBUSY" or "VALARM" calendar component. If the + + + +Desruisseaux Standards Track [Page 107] + +RFC 5545 iCalendar September 2009 + + + "LANGUAGE" property parameter is specified, the identified + language applies to the "CN" parameter. + + A recipient delegated a request MUST inherit the "RSVP" and "ROLE" + values from the attendee that delegated the request to them. + + Multiple attendees can be specified by including multiple + "ATTENDEE" properties within the calendar component. + + Format Definition: This property is defined by the following + notation: + + attendee = "ATTENDEE" attparam ":" cal-address CRLF + + attparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" cutypeparam) / (";" memberparam) / + (";" roleparam) / (";" partstatparam) / + (";" rsvpparam) / (";" deltoparam) / + (";" delfromparam) / (";" sentbyparam) / + (";" cnparam) / (";" dirparam) / + (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following are examples of this property's use for a + to-do: + + ATTENDEE;MEMBER="mailto:DEV-GROUP@example.com": + mailto:joecool@example.com + ATTENDEE;DELEGATED-FROM="mailto:immud@example.com": + mailto:ildoit@example.com + + + + + + + + + + + +Desruisseaux Standards Track [Page 108] + +RFC 5545 iCalendar September 2009 + + + The following is an example of this property used for specifying + multiple attendees to an event: + + ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;CN=Henry + Cabot:mailto:hcabot@example.com + ATTENDEE;ROLE=REQ-PARTICIPANT;DELEGATED-FROM="mailto:bob@ + example.com";PARTSTAT=ACCEPTED;CN=Jane Doe:mailto:jdoe@ + example.com + + The following is an example of this property with a URI to the + directory information associated with the attendee: + + ATTENDEE;CN=John Smith;DIR="ldap://example.com:6666/o=ABC% + 20Industries,c=US???(cn=Jim%20Dolittle)":mailto:jimdo@ + example.com + + The following is an example of this property with "delegatee" and + "delegator" information for an event: + + ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;DELEGATED-FROM= + "mailto:iamboss@example.com";CN=Henry Cabot:mailto:hcabot@ + example.com + ATTENDEE;ROLE=NON-PARTICIPANT;PARTSTAT=DELEGATED;DELEGATED-TO= + "mailto:hcabot@example.com";CN=The Big Cheese:mailto:iamboss + @example.com + ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Jane Doe + :mailto:jdoe@example.com + + Example: The following is an example of this property's use when + another calendar user is acting on behalf of the "Attendee": + + ATTENDEE;SENT-BY=mailto:jan_doe@example.com;CN=John Smith: + mailto:jsmith@example.com + +3.8.4.2. Contact + + Property Name: CONTACT + + Purpose: This property is used to represent contact information or + alternately a reference to contact information associated with the + calendar component. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, alternate text + representation, and language property parameters can be specified + on this property. + + + + +Desruisseaux Standards Track [Page 109] + +RFC 5545 iCalendar September 2009 + + + Conformance: This property can be specified in a "VEVENT", "VTODO", + "VJOURNAL", or "VFREEBUSY" calendar component. + + Description: The property value consists of textual contact + information. An alternative representation for the property value + can also be specified that refers to a URI pointing to an + alternate form, such as a vCard [RFC2426], for the contact + information. + + Format Definition: This property is defined by the following + notation: + + contact = "CONTACT" contparam ":" text CRLF + + contparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property referencing + textual contact information: + + CONTACT:Jim Dolittle\, ABC Industries\, +1-919-555-1234 + + The following is an example of this property with an alternate + representation of an LDAP URI to a directory entry containing the + contact information: + + CONTACT;ALTREP="ldap://example.com:6666/o=ABC%20Industries\, + c=US???(cn=Jim%20Dolittle)":Jim Dolittle\, ABC Industries\, + +1-919-555-1234 + + The following is an example of this property with an alternate + representation of a MIME body part containing the contact + information, such as a vCard [RFC2426] embedded in a text/ + directory media type [RFC2425]: + + CONTACT;ALTREP="CID:part3.msg970930T083000SILVER@example.com": + Jim Dolittle\, ABC Industries\, +1-919-555-1234 + + + +Desruisseaux Standards Track [Page 110] + +RFC 5545 iCalendar September 2009 + + + The following is an example of this property referencing a network + resource, such as a vCard [RFC2426] object containing the contact + information: + + CONTACT;ALTREP="http://example.com/pdi/jdoe.vcf":Jim + Dolittle\, ABC Industries\, +1-919-555-1234 + +3.8.4.3. Organizer + + Property Name: ORGANIZER + + Purpose: This property defines the organizer for a calendar + component. + + Value Type: CAL-ADDRESS + + Property Parameters: IANA, non-standard, language, common name, + directory entry reference, and sent-by property parameters can be + specified on this property. + + Conformance: This property MUST be specified in an iCalendar object + that specifies a group-scheduled calendar entity. This property + MUST be specified in an iCalendar object that specifies the + publication of a calendar user's busy time. This property MUST + NOT be specified in an iCalendar object that specifies only a time + zone definition or that defines calendar components that are not + group-scheduled components, but are components only on a single + user's calendar. + + Description: This property is specified within the "VEVENT", + "VTODO", and "VJOURNAL" calendar components to specify the + organizer of a group-scheduled calendar entity. The property is + specified within the "VFREEBUSY" calendar component to specify the + calendar user requesting the free or busy time. When publishing a + "VFREEBUSY" calendar component, the property is used to specify + the calendar that the published busy time came from. + + The property has the property parameters "CN", for specifying the + common or display name associated with the "Organizer", "DIR", for + specifying a pointer to the directory information associated with + the "Organizer", "SENT-BY", for specifying another calendar user + that is acting on behalf of the "Organizer". The non-standard + parameters may also be specified on this property. If the + "LANGUAGE" property parameter is specified, the identified + language applies to the "CN" parameter value. + + + + + + +Desruisseaux Standards Track [Page 111] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + organizer = "ORGANIZER" orgparam ":" + cal-address CRLF + + orgparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" cnparam) / (";" dirparam) / (";" sentbyparam) / + (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property: + + ORGANIZER;CN=John Smith:mailto:jsmith@example.com + + The following is an example of this property with a pointer to the + directory information associated with the organizer: + + ORGANIZER;CN=JohnSmith;DIR="ldap://example.com:6666/o=DC%20Ass + ociates,c=US???(cn=John%20Smith)":mailto:jsmith@example.com + + The following is an example of this property used by another + calendar user who is acting on behalf of the organizer, with + responses intended to be sent back to the organizer, not the other + calendar user: + + ORGANIZER;SENT-BY="mailto:jane_doe@example.com": + mailto:jsmith@example.com + +3.8.4.4. Recurrence ID + + Property Name: RECURRENCE-ID + + Purpose: This property is used in conjunction with the "UID" and + "SEQUENCE" properties to identify a specific instance of a + recurring "VEVENT", "VTODO", or "VJOURNAL" calendar component. + The property value is the original value of the "DTSTART" property + of the recurrence instance. + + + +Desruisseaux Standards Track [Page 112] + +RFC 5545 iCalendar September 2009 + + + Value Type: The default value type is DATE-TIME. The value type can + be set to a DATE value type. This property MUST have the same + value type as the "DTSTART" property contained within the + recurring component. Furthermore, this property MUST be specified + as a date with local time if and only if the "DTSTART" property + contained within the recurring component is specified as a date + with local time. + + Property Parameters: IANA, non-standard, value data type, time zone + identifier, and recurrence identifier range parameters can be + specified on this property. + + Conformance: This property can be specified in an iCalendar object + containing a recurring calendar component. + + Description: The full range of calendar components specified by a + recurrence set is referenced by referring to just the "UID" + property value corresponding to the calendar component. The + "RECURRENCE-ID" property allows the reference to an individual + instance within the recurrence set. + + If the value of the "DTSTART" property is a DATE type value, then + the value MUST be the calendar date for the recurrence instance. + + The DATE-TIME value is set to the time when the original + recurrence instance would occur; meaning that if the intent is to + change a Friday meeting to Thursday, the DATE-TIME is still set to + the original Friday meeting. + + The "RECURRENCE-ID" property is used in conjunction with the "UID" + and "SEQUENCE" properties to identify a particular instance of a + recurring event, to-do, or journal. For a given pair of "UID" and + "SEQUENCE" property values, the "RECURRENCE-ID" value for a + recurrence instance is fixed. + + The "RANGE" parameter is used to specify the effective range of + recurrence instances from the instance specified by the + "RECURRENCE-ID" property value. The value for the range parameter + can only be "THISANDFUTURE" to indicate a range defined by the + given recurrence instance and all subsequent instances. + Subsequent instances are determined by their "RECURRENCE-ID" value + and not their current scheduled start time. Subsequent instances + defined in separate components are not impacted by the given + recurrence instance. When the given recurrence instance is + rescheduled, all subsequent instances are also rescheduled by the + same time difference. For instance, if the given recurrence + instance is rescheduled to start 2 hours later, then all + subsequent instances are also rescheduled 2 hours later. + + + +Desruisseaux Standards Track [Page 113] + +RFC 5545 iCalendar September 2009 + + + Similarly, if the duration of the given recurrence instance is + modified, then all subsequence instances are also modified to have + this same duration. + + Note: The "RANGE" parameter may not be appropriate to + reschedule specific subsequent instances of complex recurring + calendar component. Assuming an unbounded recurring calendar + component scheduled to occur on Mondays and Wednesdays, the + "RANGE" parameter could not be used to reschedule only the + future Monday instances to occur on Tuesday instead. In such + cases, the calendar application could simply truncate the + unbounded recurring calendar component (i.e., with the "COUNT" + or "UNTIL" rule parts), and create two new unbounded recurring + calendar components for the future instances. + + Format Definition: This property is defined by the following + notation: + + recurid = "RECURRENCE-ID" ridparam ":" ridval CRLF + + ridparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("DATE-TIME" / "DATE")) / + (";" tzidparam) / (";" rangeparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + ridval = date-time / date + ;Value MUST match value type + + Example: The following are examples of this property: + + RECURRENCE-ID;VALUE=DATE:19960401 + + RECURRENCE-ID;RANGE=THISANDFUTURE:19960120T120000Z + + + + + + + + +Desruisseaux Standards Track [Page 114] + +RFC 5545 iCalendar September 2009 + + +3.8.4.5. Related To + + Property Name: RELATED-TO + + Purpose: This property is used to represent a relationship or + reference between one calendar component and another. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, and relationship type + property parameters can be specified on this property. + + Conformance: This property can be specified in the "VEVENT", + "VTODO", and "VJOURNAL" calendar components. + + Description: The property value consists of the persistent, globally + unique identifier of another calendar component. This value would + be represented in a calendar component by the "UID" property. + + By default, the property value points to another calendar + component that has a PARENT relationship to the referencing + object. The "RELTYPE" property parameter is used to either + explicitly state the default PARENT relationship type to the + referenced calendar component or to override the default PARENT + relationship type and specify either a CHILD or SIBLING + relationship. The PARENT relationship indicates that the calendar + component is a subordinate of the referenced calendar component. + The CHILD relationship indicates that the calendar component is a + superior of the referenced calendar component. The SIBLING + relationship indicates that the calendar component is a peer of + the referenced calendar component. + + Changes to a calendar component referenced by this property can + have an implicit impact on the related calendar component. For + example, if a group event changes its start or end date or time, + then the related, dependent events will need to have their start + and end dates changed in a corresponding way. Similarly, if a + PARENT calendar component is cancelled or deleted, then there is + an implied impact to the related CHILD calendar components. This + property is intended only to provide information on the + relationship of calendar components. It is up to the target + calendar system to maintain any property implications of this + relationship. + + + + + + + + +Desruisseaux Standards Track [Page 115] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + related = "RELATED-TO" relparam ":" text CRLF + + relparam = *( + ; + ; The following is OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" reltypeparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + The following is an example of this property: + + RELATED-TO:jsmith.part7.19960817T083000.xyzMail@example.com + + RELATED-TO:19960401-080045-4000F192713-0052@example.com + +3.8.4.6. Uniform Resource Locator + + Property Name: URL + + Purpose: This property defines a Uniform Resource Locator (URL) + associated with the iCalendar object. + + Value Type: URI + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified once in the "VEVENT", + "VTODO", "VJOURNAL", or "VFREEBUSY" calendar components. + + Description: This property may be used in a calendar component to + convey a location where a more dynamic rendition of the calendar + information associated with the calendar component can be found. + This memo does not attempt to standardize the form of the URI, nor + the format of the resource pointed to by the property value. If + the URL property and Content-Location MIME header are both + specified, they MUST point to the same resource. + + + + +Desruisseaux Standards Track [Page 116] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + url = "URL" urlparam ":" uri CRLF + + urlparam = *(";" other-param) + + Example: The following is an example of this property: + + URL:http://example.com/pub/calendars/jsmith/mytime.ics + +3.8.4.7. Unique Identifier + + Property Name: UID + + Purpose: This property defines the persistent, globally unique + identifier for the calendar component. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: The property MUST be specified in the "VEVENT", + "VTODO", "VJOURNAL", or "VFREEBUSY" calendar components. + + Description: The "UID" itself MUST be a globally unique identifier. + The generator of the identifier MUST guarantee that the identifier + is unique. There are several algorithms that can be used to + accomplish this. A good method to assure uniqueness is to put the + domain name or a domain literal IP address of the host on which + the identifier was created on the right-hand side of an "@", and + on the left-hand side, put a combination of the current calendar + date and time of day (i.e., formatted in as a DATE-TIME value) + along with some other currently unique (perhaps sequential) + identifier available on the system (for example, a process id + number). Using a DATE-TIME value on the left-hand side and a + domain name or domain literal on the right-hand side makes it + possible to guarantee uniqueness since no two hosts should be + using the same domain name or IP address at the same time. Though + other algorithms will work, it is RECOMMENDED that the right-hand + side contain some domain identifier (either of the host itself or + otherwise) such that the generator of the message identifier can + guarantee the uniqueness of the left-hand side within the scope of + that domain. + + This is the method for correlating scheduling messages with the + referenced "VEVENT", "VTODO", or "VJOURNAL" calendar component. + + + +Desruisseaux Standards Track [Page 117] + +RFC 5545 iCalendar September 2009 + + + The full range of calendar components specified by a recurrence + set is referenced by referring to just the "UID" property value + corresponding to the calendar component. The "RECURRENCE-ID" + property allows the reference to an individual instance within the + recurrence set. + + This property is an important method for group-scheduling + applications to match requests with later replies, modifications, + or deletion requests. Calendaring and scheduling applications + MUST generate this property in "VEVENT", "VTODO", and "VJOURNAL" + calendar components to assure interoperability with other group- + scheduling applications. This identifier is created by the + calendar system that generates an iCalendar object. + + Implementations MUST be able to receive and persist values of at + least 255 octets for this property, but they MUST NOT truncate + values in the middle of a UTF-8 multi-octet sequence. + + Format Definition: This property is defined by the following + notation: + + uid = "UID" uidparam ":" text CRLF + + uidparam = *(";" other-param) + + Example: The following is an example of this property: + + UID:19960401T080045Z-4000F192713-0052@example.com + +3.8.5. Recurrence Component Properties + + The following properties specify recurrence information in calendar + components. + +3.8.5.1. Exception Date-Times + + Property Name: EXDATE + + Purpose: This property defines the list of DATE-TIME exceptions for + recurring events, to-dos, journal entries, or time zone + definitions. + + Value Type: The default value type for this property is DATE-TIME. + The value type can be set to DATE. + + Property Parameters: IANA, non-standard, value data type, and time + zone identifier property parameters can be specified on this + property. + + + +Desruisseaux Standards Track [Page 118] + +RFC 5545 iCalendar September 2009 + + + Conformance: This property can be specified in recurring "VEVENT", + "VTODO", and "VJOURNAL" calendar components as well as in the + "STANDARD" and "DAYLIGHT" sub-components of the "VTIMEZONE" + calendar component. + + Description: The exception dates, if specified, are used in + computing the recurrence set. The recurrence set is the complete + set of recurrence instances for a calendar component. The + recurrence set is generated by considering the initial "DTSTART" + property along with the "RRULE", "RDATE", and "EXDATE" properties + contained within the recurring component. The "DTSTART" property + defines the first instance in the recurrence set. The "DTSTART" + property value SHOULD match the pattern of the recurrence rule, if + specified. The recurrence set generated with a "DTSTART" property + value that doesn't match the pattern of the rule is undefined. + The final recurrence set is generated by gathering all of the + start DATE-TIME values generated by any of the specified "RRULE" + and "RDATE" properties, and then excluding any start DATE-TIME + values specified by "EXDATE" properties. This implies that start + DATE-TIME values specified by "EXDATE" properties take precedence + over those specified by inclusion properties (i.e., "RDATE" and + "RRULE"). When duplicate instances are generated by the "RRULE" + and "RDATE" properties, only one recurrence is considered. + Duplicate instances are ignored. + + The "EXDATE" property can be used to exclude the value specified + in "DTSTART". However, in such cases, the original "DTSTART" date + MUST still be maintained by the calendaring and scheduling system + because the original "DTSTART" value has inherent usage + dependencies by other properties such as the "RECURRENCE-ID". + + Format Definition: This property is defined by the following + notation: + + + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 119] + +RFC 5545 iCalendar September 2009 + + + exdate = "EXDATE" exdtparam ":" exdtval *("," exdtval) CRLF + + exdtparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("DATE-TIME" / "DATE")) / + ; + (";" tzidparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + exdtval = date-time / date + ;Value MUST match value type + + Example: The following is an example of this property: + + EXDATE:19960402T010000Z,19960403T010000Z,19960404T010000Z + +3.8.5.2. Recurrence Date-Times + + Property Name: RDATE + + Purpose: This property defines the list of DATE-TIME values for + recurring events, to-dos, journal entries, or time zone + definitions. + + Value Type: The default value type for this property is DATE-TIME. + The value type can be set to DATE or PERIOD. + + Property Parameters: IANA, non-standard, value data type, and time + zone identifier property parameters can be specified on this + property. + + Conformance: This property can be specified in recurring "VEVENT", + "VTODO", and "VJOURNAL" calendar components as well as in the + "STANDARD" and "DAYLIGHT" sub-components of the "VTIMEZONE" + calendar component. + + Description: This property can appear along with the "RRULE" + property to define an aggregate set of repeating occurrences. + When they both appear in a recurring component, the recurrence + + + +Desruisseaux Standards Track [Page 120] + +RFC 5545 iCalendar September 2009 + + + instances are defined by the union of occurrences defined by both + the "RDATE" and "RRULE". + + The recurrence dates, if specified, are used in computing the + recurrence set. The recurrence set is the complete set of + recurrence instances for a calendar component. The recurrence set + is generated by considering the initial "DTSTART" property along + with the "RRULE", "RDATE", and "EXDATE" properties contained + within the recurring component. The "DTSTART" property defines + the first instance in the recurrence set. The "DTSTART" property + value SHOULD match the pattern of the recurrence rule, if + specified. The recurrence set generated with a "DTSTART" property + value that doesn't match the pattern of the rule is undefined. + The final recurrence set is generated by gathering all of the + start DATE-TIME values generated by any of the specified "RRULE" + and "RDATE" properties, and then excluding any start DATE-TIME + values specified by "EXDATE" properties. This implies that start + DATE-TIME values specified by "EXDATE" properties take precedence + over those specified by inclusion properties (i.e., "RDATE" and + "RRULE"). Where duplicate instances are generated by the "RRULE" + and "RDATE" properties, only one recurrence is considered. + Duplicate instances are ignored. + + Format Definition: This property is defined by the following + notation: + + rdate = "RDATE" rdtparam ":" rdtval *("," rdtval) CRLF + + rdtparam = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("DATE-TIME" / "DATE" / "PERIOD")) / + (";" tzidparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + rdtval = date-time / date / period + ;Value MUST match value type + + + + + + +Desruisseaux Standards Track [Page 121] + +RFC 5545 iCalendar September 2009 + + + Example: The following are examples of this property: + + RDATE:19970714T123000Z + RDATE;TZID=America/New_York:19970714T083000 + + RDATE;VALUE=PERIOD:19960403T020000Z/19960403T040000Z, + 19960404T010000Z/PT3H + + RDATE;VALUE=DATE:19970101,19970120,19970217,19970421 + 19970526,19970704,19970901,19971014,19971128,19971129,19971225 + +3.8.5.3. Recurrence Rule + + Property Name: RRULE + + Purpose: This property defines a rule or repeating pattern for + recurring events, to-dos, journal entries, or time zone + definitions. + + Value Type: RECUR + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in recurring "VEVENT", + "VTODO", and "VJOURNAL" calendar components as well as in the + "STANDARD" and "DAYLIGHT" sub-components of the "VTIMEZONE" + calendar component, but it SHOULD NOT be specified more than once. + The recurrence set generated with multiple "RRULE" properties is + undefined. + + Description: The recurrence rule, if specified, is used in computing + the recurrence set. The recurrence set is the complete set of + recurrence instances for a calendar component. The recurrence set + is generated by considering the initial "DTSTART" property along + with the "RRULE", "RDATE", and "EXDATE" properties contained + within the recurring component. The "DTSTART" property defines + the first instance in the recurrence set. The "DTSTART" property + value SHOULD be synchronized with the recurrence rule, if + specified. The recurrence set generated with a "DTSTART" property + value not synchronized with the recurrence rule is undefined. The + final recurrence set is generated by gathering all of the start + DATE-TIME values generated by any of the specified "RRULE" and + "RDATE" properties, and then excluding any start DATE-TIME values + specified by "EXDATE" properties. This implies that start DATE- + TIME values specified by "EXDATE" properties take precedence over + those specified by inclusion properties (i.e., "RDATE" and + "RRULE"). Where duplicate instances are generated by the "RRULE" + + + +Desruisseaux Standards Track [Page 122] + +RFC 5545 iCalendar September 2009 + + + and "RDATE" properties, only one recurrence is considered. + Duplicate instances are ignored. + + The "DTSTART" property specified within the iCalendar object + defines the first instance of the recurrence. In most cases, a + "DTSTART" property of DATE-TIME value type used with a recurrence + rule, should be specified as a date with local time and time zone + reference to make sure all the recurrence instances start at the + same local time regardless of time zone changes. + + If the duration of the recurring component is specified with the + "DTEND" or "DUE" property, then the same exact duration will apply + to all the members of the generated recurrence set. Else, if the + duration of the recurring component is specified with the + "DURATION" property, then the same nominal duration will apply to + all the members of the generated recurrence set and the exact + duration of each recurrence instance will depend on its specific + start time. For example, recurrence instances of a nominal + duration of one day will have an exact duration of more or less + than 24 hours on a day where a time zone shift occurs. The + duration of a specific recurrence may be modified in an exception + component or simply by using an "RDATE" property of PERIOD value + type. + + Format Definition: This property is defined by the following + notation: + + rrule = "RRULE" rrulparam ":" recur CRLF + + rrulparam = *(";" other-param) + + Example: All examples assume the Eastern United States time zone. + + Daily for 10 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=DAILY;COUNT=10 + + ==> (1997 9:00 AM EDT) September 2-11 + + Daily until December 24, 1997: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=DAILY;UNTIL=19971224T000000Z + + ==> (1997 9:00 AM EDT) September 2-30;October 1-25 + (1997 9:00 AM EST) October 26-31;November 1-30;December 1-23 + + + + +Desruisseaux Standards Track [Page 123] + +RFC 5545 iCalendar September 2009 + + + Every other day - forever: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=DAILY;INTERVAL=2 + + ==> (1997 9:00 AM EDT) September 2,4,6,8...24,26,28,30; + October 2,4,6...20,22,24 + (1997 9:00 AM EST) October 26,28,30; + November 1,3,5,7...25,27,29; + December 1,3,... + + Every 10 days, 5 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5 + + ==> (1997 9:00 AM EDT) September 2,12,22; + October 2,12 + + Every day in January, for 3 years: + + DTSTART;TZID=America/New_York:19980101T090000 + + RRULE:FREQ=YEARLY;UNTIL=20000131T140000Z; + BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA + or + RRULE:FREQ=DAILY;UNTIL=20000131T140000Z;BYMONTH=1 + + ==> (1998 9:00 AM EST)January 1-31 + (1999 9:00 AM EST)January 1-31 + (2000 9:00 AM EST)January 1-31 + + Weekly for 10 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=WEEKLY;COUNT=10 + + ==> (1997 9:00 AM EDT) September 2,9,16,23,30;October 7,14,21 + (1997 9:00 AM EST) October 28;November 4 + + + + + + + + + + + + +Desruisseaux Standards Track [Page 124] + +RFC 5545 iCalendar September 2009 + + + Weekly until December 24, 1997: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=WEEKLY;UNTIL=19971224T000000Z + + ==> (1997 9:00 AM EDT) September 2,9,16,23,30; + October 7,14,21 + (1997 9:00 AM EST) October 28; + November 4,11,18,25; + December 2,9,16,23 + + Every other week - forever: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU + + ==> (1997 9:00 AM EDT) September 2,16,30; + October 14 + (1997 9:00 AM EST) October 28; + November 11,25; + December 9,23 + (1998 9:00 AM EST) January 6,20; + February 3, 17 + ... + + Weekly on Tuesday and Thursday for five weeks: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH + + or + + RRULE:FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH + + ==> (1997 9:00 AM EDT) September 2,4,9,11,16,18,23,25,30; + October 2 + + Every other week on Monday, Wednesday, and Friday until December + 24, 1997, starting on Monday, September 1, 1997: + + DTSTART;TZID=America/New_York:19970901T090000 + RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU; + BYDAY=MO,WE,FR + + ==> (1997 9:00 AM EDT) September 1,3,5,15,17,19,29; + October 1,3,13,15,17 + (1997 9:00 AM EST) October 27,29,31; + November 10,12,14,24,26,28; + + + +Desruisseaux Standards Track [Page 125] + +RFC 5545 iCalendar September 2009 + + + December 8,10,12,22 + + Every other week on Tuesday and Thursday, for 8 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH + + ==> (1997 9:00 AM EDT) September 2,4,16,18,30; + October 2,14,16 + + Monthly on the first Friday for 10 occurrences: + + DTSTART;TZID=America/New_York:19970905T090000 + RRULE:FREQ=MONTHLY;COUNT=10;BYDAY=1FR + + ==> (1997 9:00 AM EDT) September 5;October 3 + (1997 9:00 AM EST) November 7;December 5 + (1998 9:00 AM EST) January 2;February 6;March 6;April 3 + (1998 9:00 AM EDT) May 1;June 5 + + Monthly on the first Friday until December 24, 1997: + + DTSTART;TZID=America/New_York:19970905T090000 + RRULE:FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR + + ==> (1997 9:00 AM EDT) September 5; October 3 + (1997 9:00 AM EST) November 7; December 5 + + Every other month on the first and last Sunday of the month for 10 + occurrences: + + DTSTART;TZID=America/New_York:19970907T090000 + RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU + + ==> (1997 9:00 AM EDT) September 7,28 + (1997 9:00 AM EST) November 2,30 + (1998 9:00 AM EST) January 4,25;March 1,29 + (1998 9:00 AM EDT) May 3,31 + + Monthly on the second-to-last Monday of the month for 6 months: + + DTSTART;TZID=America/New_York:19970922T090000 + RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO + + ==> (1997 9:00 AM EDT) September 22;October 20 + (1997 9:00 AM EST) November 17;December 22 + (1998 9:00 AM EST) January 19;February 16 + + + + +Desruisseaux Standards Track [Page 126] + +RFC 5545 iCalendar September 2009 + + + Monthly on the third-to-the-last day of the month, forever: + + DTSTART;TZID=America/New_York:19970928T090000 + RRULE:FREQ=MONTHLY;BYMONTHDAY=-3 + + ==> (1997 9:00 AM EDT) September 28 + (1997 9:00 AM EST) October 29;November 28;December 29 + (1998 9:00 AM EST) January 29;February 26 + ... + + Monthly on the 2nd and 15th of the month for 10 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15 + + ==> (1997 9:00 AM EDT) September 2,15;October 2,15 + (1997 9:00 AM EST) November 2,15;December 2,15 + (1998 9:00 AM EST) January 2,15 + + Monthly on the first and last day of the month for 10 occurrences: + + DTSTART;TZID=America/New_York:19970930T090000 + RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1 + + ==> (1997 9:00 AM EDT) September 30;October 1 + (1997 9:00 AM EST) October 31;November 1,30;December 1,31 + (1998 9:00 AM EST) January 1,31;February 1 + + Every 18 months on the 10th thru 15th of the month for 10 + occurrences: + + DTSTART;TZID=America/New_York:19970910T090000 + RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12, + 13,14,15 + + ==> (1997 9:00 AM EDT) September 10,11,12,13,14,15 + (1999 9:00 AM EST) March 10,11,12,13 + + Every Tuesday, every other month: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=MONTHLY;INTERVAL=2;BYDAY=TU + + ==> (1997 9:00 AM EDT) September 2,9,16,23,30 + (1997 9:00 AM EST) November 4,11,18,25 + (1998 9:00 AM EST) January 6,13,20,27;March 3,10,17,24,31 + ... + + + + +Desruisseaux Standards Track [Page 127] + +RFC 5545 iCalendar September 2009 + + + Yearly in June and July for 10 occurrences: + + DTSTART;TZID=America/New_York:19970610T090000 + RRULE:FREQ=YEARLY;COUNT=10;BYMONTH=6,7 + + ==> (1997 9:00 AM EDT) June 10;July 10 + (1998 9:00 AM EDT) June 10;July 10 + (1999 9:00 AM EDT) June 10;July 10 + (2000 9:00 AM EDT) June 10;July 10 + (2001 9:00 AM EDT) June 10;July 10 + + Note: Since none of the BYDAY, BYMONTHDAY, or BYYEARDAY + components are specified, the day is gotten from "DTSTART". + + Every other year on January, February, and March for 10 + occurrences: + + DTSTART;TZID=America/New_York:19970310T090000 + RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3 + + ==> (1997 9:00 AM EST) March 10 + (1999 9:00 AM EST) January 10;February 10;March 10 + (2001 9:00 AM EST) January 10;February 10;March 10 + (2003 9:00 AM EST) January 10;February 10;March 10 + + Every third year on the 1st, 100th, and 200th day for 10 + occurrences: + + DTSTART;TZID=America/New_York:19970101T090000 + RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200 + + ==> (1997 9:00 AM EST) January 1 + (1997 9:00 AM EDT) April 10;July 19 + (2000 9:00 AM EST) January 1 + (2000 9:00 AM EDT) April 9;July 18 + (2003 9:00 AM EST) January 1 + (2003 9:00 AM EDT) April 10;July 19 + (2006 9:00 AM EST) January 1 + + Every 20th Monday of the year, forever: + + DTSTART;TZID=America/New_York:19970519T090000 + RRULE:FREQ=YEARLY;BYDAY=20MO + + ==> (1997 9:00 AM EDT) May 19 + (1998 9:00 AM EDT) May 18 + (1999 9:00 AM EDT) May 17 + ... + + + +Desruisseaux Standards Track [Page 128] + +RFC 5545 iCalendar September 2009 + + + Monday of week number 20 (where the default start of the week is + Monday), forever: + + DTSTART;TZID=America/New_York:19970512T090000 + RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO + + ==> (1997 9:00 AM EDT) May 12 + (1998 9:00 AM EDT) May 11 + (1999 9:00 AM EDT) May 17 + ... + + Every Thursday in March, forever: + + DTSTART;TZID=America/New_York:19970313T090000 + RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=TH + + ==> (1997 9:00 AM EST) March 13,20,27 + (1998 9:00 AM EST) March 5,12,19,26 + (1999 9:00 AM EST) March 4,11,18,25 + ... + + Every Thursday, but only during June, July, and August, forever: + + DTSTART;TZID=America/New_York:19970605T090000 + RRULE:FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8 + + ==> (1997 9:00 AM EDT) June 5,12,19,26;July 3,10,17,24,31; + August 7,14,21,28 + (1998 9:00 AM EDT) June 4,11,18,25;July 2,9,16,23,30; + August 6,13,20,27 + (1999 9:00 AM EDT) June 3,10,17,24;July 1,8,15,22,29; + August 5,12,19,26 + ... + + Every Friday the 13th, forever: + + DTSTART;TZID=America/New_York:19970902T090000 + EXDATE;TZID=America/New_York:19970902T090000 + RRULE:FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13 + + ==> (1998 9:00 AM EST) February 13;March 13;November 13 + (1999 9:00 AM EDT) August 13 + (2000 9:00 AM EDT) October 13 + ... + + + + + + + +Desruisseaux Standards Track [Page 129] + +RFC 5545 iCalendar September 2009 + + + The first Saturday that follows the first Sunday of the month, + forever: + + DTSTART;TZID=America/New_York:19970913T090000 + RRULE:FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13 + + ==> (1997 9:00 AM EDT) September 13;October 11 + (1997 9:00 AM EST) November 8;December 13 + (1998 9:00 AM EST) January 10;February 7;March 7 + (1998 9:00 AM EDT) April 11;May 9;June 13... + ... + + Every 4 years, the first Tuesday after a Monday in November, + forever (U.S. Presidential Election day): + + DTSTART;TZID=America/New_York:19961105T090000 + RRULE:FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU; + BYMONTHDAY=2,3,4,5,6,7,8 + + ==> (1996 9:00 AM EST) November 5 + (2000 9:00 AM EST) November 7 + (2004 9:00 AM EST) November 2 + ... + + The third instance into the month of one of Tuesday, Wednesday, or + Thursday, for the next 3 months: + + DTSTART;TZID=America/New_York:19970904T090000 + RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3 + + ==> (1997 9:00 AM EDT) September 4;October 7 + (1997 9:00 AM EST) November 6 + + The second-to-last weekday of the month: + + DTSTART;TZID=America/New_York:19970929T090000 + RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2 + + ==> (1997 9:00 AM EDT) September 29 + (1997 9:00 AM EST) October 30;November 27;December 30 + (1998 9:00 AM EST) January 29;February 26;March 30 + ... + + + + + + + + + +Desruisseaux Standards Track [Page 130] + +RFC 5545 iCalendar September 2009 + + + Every 3 hours from 9:00 AM to 5:00 PM on a specific day: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z + + ==> (September 2, 1997 EDT) 09:00,12:00,15:00 + + Every 15 minutes for 6 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6 + + ==> (September 2, 1997 EDT) 09:00,09:15,09:30,09:45,10:00,10:15 + + Every hour and a half for 4 occurrences: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4 + + ==> (September 2, 1997 EDT) 09:00,10:30;12:00;13:30 + + Every 20 minutes from 9:00 AM to 4:40 PM every day: + + DTSTART;TZID=America/New_York:19970902T090000 + RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40 + or + RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16 + + ==> (September 2, 1997 EDT) 9:00,9:20,9:40,10:00,10:20, + ... 16:00,16:20,16:40 + (September 3, 1997 EDT) 9:00,9:20,9:40,10:00,10:20, + ...16:00,16:20,16:40 + ... + + An example where the days generated makes a difference because of + WKST: + + DTSTART;TZID=America/New_York:19970805T090000 + RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO + + ==> (1997 EDT) August 5,10,19,24 + + changing only WKST from MO to SU, yields different results... + + DTSTART;TZID=America/New_York:19970805T090000 + RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU + + ==> (1997 EDT) August 5,17,19,31 + + + +Desruisseaux Standards Track [Page 131] + +RFC 5545 iCalendar September 2009 + + + An example where an invalid date (i.e., February 30) is ignored. + + DTSTART;TZID=America/New_York:20070115T090000 + RRULE:FREQ=MONTHLY;BYMONTHDAY=15,30;COUNT=5 + + ==> (2007 EST) January 15,30 + (2007 EST) February 15 + (2007 EDT) March 15,30 + +3.8.6. Alarm Component Properties + + The following properties specify alarm information in calendar + components. + +3.8.6.1. Action + + Property Name: ACTION + + Purpose: This property defines the action to be invoked when an + alarm is triggered. + + Value Type: TEXT + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property MUST be specified once in a "VALARM" + calendar component. + + Description: Each "VALARM" calendar component has a particular type + of action with which it is associated. This property specifies + the type of action. Applications MUST ignore alarms with x-name + and iana-token values they don't recognize. + + Format Definition: This property is defined by the following + notation: + + action = "ACTION" actionparam ":" actionvalue CRLF + + actionparam = *(";" other-param) + + + actionvalue = "AUDIO" / "DISPLAY" / "EMAIL" + / iana-token / x-name + + Example: The following are examples of this property in a "VALARM" + calendar component: + + + + +Desruisseaux Standards Track [Page 132] + +RFC 5545 iCalendar September 2009 + + + ACTION:AUDIO + + ACTION:DISPLAY + +3.8.6.2. Repeat Count + + Property Name: REPEAT + + Purpose: This property defines the number of times the alarm should + be repeated, after the initial trigger. + + Value Type: INTEGER + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in a "VALARM" calendar + component. + + Description: This property defines the number of times an alarm + should be repeated after its initial trigger. If the alarm + triggers more than once, then this property MUST be specified + along with the "DURATION" property. + + Format Definition: This property is defined by the following + notation: + + repeat = "REPEAT" repparam ":" integer CRLF + ;Default is "0", zero. + + repparam = *(";" other-param) + + Example: The following is an example of this property for an alarm + that repeats 4 additional times with a 5-minute delay after the + initial triggering of the alarm: + + REPEAT:4 + DURATION:PT5M + +3.8.6.3. Trigger + + Property Name: TRIGGER + + Purpose: This property specifies when an alarm will trigger. + + Value Type: The default value type is DURATION. The value type can + be set to a DATE-TIME value type, in which case the value MUST + specify a UTC-formatted DATE-TIME value. + + + +Desruisseaux Standards Track [Page 133] + +RFC 5545 iCalendar September 2009 + + + Property Parameters: IANA, non-standard, value data type, time zone + identifier, or trigger relationship property parameters can be + specified on this property. The trigger relationship property + parameter MUST only be specified when the value type is + "DURATION". + + Conformance: This property MUST be specified in the "VALARM" + calendar component. + + Description: This property defines when an alarm will trigger. The + default value type is DURATION, specifying a relative time for the + trigger of the alarm. The default duration is relative to the + start of an event or to-do with which the alarm is associated. + The duration can be explicitly set to trigger from either the end + or the start of the associated event or to-do with the "RELATED" + parameter. A value of START will set the alarm to trigger off the + start of the associated event or to-do. A value of END will set + the alarm to trigger off the end of the associated event or to-do. + + Either a positive or negative duration may be specified for the + "TRIGGER" property. An alarm with a positive duration is + triggered after the associated start or end of the event or to-do. + An alarm with a negative duration is triggered before the + associated start or end of the event or to-do. + + The "RELATED" property parameter is not valid if the value type of + the property is set to DATE-TIME (i.e., for an absolute date and + time alarm trigger). If a value type of DATE-TIME is specified, + then the property value MUST be specified in the UTC time format. + If an absolute trigger is specified on an alarm for a recurring + event or to-do, then the alarm will only trigger for the specified + absolute DATE-TIME, along with any specified repeating instances. + + If the trigger is set relative to START, then the "DTSTART" + property MUST be present in the associated "VEVENT" or "VTODO" + calendar component. If an alarm is specified for an event with + the trigger set relative to the END, then the "DTEND" property or + the "DTSTART" and "DURATION " properties MUST be present in the + associated "VEVENT" calendar component. If the alarm is specified + for a to-do with a trigger set relative to the END, then either + the "DUE" property or the "DTSTART" and "DURATION " properties + MUST be present in the associated "VTODO" calendar component. + + Alarms specified in an event or to-do that is defined in terms of + a DATE value type will be triggered relative to 00:00:00 of the + user's configured time zone on the specified date, or relative to + 00:00:00 UTC on the specified date if no configured time zone can + be found for the user. For example, if "DTSTART" is a DATE value + + + +Desruisseaux Standards Track [Page 134] + +RFC 5545 iCalendar September 2009 + + + set to 19980205 then the duration trigger will be relative to + 19980205T000000 America/New_York for a user configured with the + America/New_York time zone. + + Format Definition: This property is defined by the following + notation: + + trigger = "TRIGGER" (trigrel / trigabs) CRLF + + trigrel = *( + ; + ; The following are OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" "DURATION") / + (";" trigrelparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) ":" dur-value + + trigabs = *( + ; + ; The following is REQUIRED, + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" "DATE-TIME") / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) ":" date-time + + Example: A trigger set 15 minutes prior to the start of the event or + to-do. + + TRIGGER:-PT15M + + A trigger set five minutes after the end of an event or the due + date of a to-do. + + TRIGGER;RELATED=END:PT5M + + + + +Desruisseaux Standards Track [Page 135] + +RFC 5545 iCalendar September 2009 + + + A trigger set to an absolute DATE-TIME. + + TRIGGER;VALUE=DATE-TIME:19980101T050000Z + +3.8.7. Change Management Component Properties + + The following properties specify change management information in + calendar components. + +3.8.7.1. Date-Time Created + + Property Name: CREATED + + Purpose: This property specifies the date and time that the calendar + information was created by the calendar user agent in the calendar + store. + + Note: This is analogous to the creation date and time for a + file in the file system. + + Value Type: DATE-TIME + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: The property can be specified once in "VEVENT", + "VTODO", or "VJOURNAL" calendar components. The value MUST be + specified as a date with UTC time. + + Description: This property specifies the date and time that the + calendar information was created by the calendar user agent in the + calendar store. + + Format Definition: This property is defined by the following + notation: + + created = "CREATED" creaparam ":" date-time CRLF + + creaparam = *(";" other-param) + + Example: The following is an example of this property: + + CREATED:19960329T133000Z + + + + + + + + +Desruisseaux Standards Track [Page 136] + +RFC 5545 iCalendar September 2009 + + +3.8.7.2. Date-Time Stamp + + Property Name: DTSTAMP + + Purpose: In the case of an iCalendar object that specifies a + "METHOD" property, this property specifies the date and time that + the instance of the iCalendar object was created. In the case of + an iCalendar object that doesn't specify a "METHOD" property, this + property specifies the date and time that the information + associated with the calendar component was last revised in the + calendar store. + + Value Type: DATE-TIME + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property MUST be included in the "VEVENT", + "VTODO", "VJOURNAL", or "VFREEBUSY" calendar components. + + Description: The value MUST be specified in the UTC time format. + + This property is also useful to protocols such as [2447bis] that + have inherent latency issues with the delivery of content. This + property will assist in the proper sequencing of messages + containing iCalendar objects. + + In the case of an iCalendar object that specifies a "METHOD" + property, this property differs from the "CREATED" and "LAST- + MODIFIED" properties. These two properties are used to specify + when the particular calendar data in the calendar store was + created and last modified. This is different than when the + iCalendar object representation of the calendar service + information was created or last modified. + + In the case of an iCalendar object that doesn't specify a "METHOD" + property, this property is equivalent to the "LAST-MODIFIED" + property. + + Format Definition: This property is defined by the following + notation: + + dtstamp = "DTSTAMP" stmparam ":" date-time CRLF + + stmparam = *(";" other-param) + + + + + + +Desruisseaux Standards Track [Page 137] + +RFC 5545 iCalendar September 2009 + + + Example: + + DTSTAMP:19971210T080000Z + +3.8.7.3. Last Modified + + Property Name: LAST-MODIFIED + + Purpose: This property specifies the date and time that the + information associated with the calendar component was last + revised in the calendar store. + + Note: This is analogous to the modification date and time for a + file in the file system. + + Value Type: DATE-TIME + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + Conformance: This property can be specified in the "VEVENT", + "VTODO", "VJOURNAL", or "VTIMEZONE" calendar components. + + Description: The property value MUST be specified in the UTC time + format. + + Format Definition: This property is defined by the following + notation: + + last-mod = "LAST-MODIFIED" lstparam ":" date-time CRLF + + lstparam = *(";" other-param) + + Example: The following is an example of this property: + + LAST-MODIFIED:19960817T133000Z + +3.8.7.4. Sequence Number + + Property Name: SEQUENCE + + Purpose: This property defines the revision sequence number of the + calendar component within a sequence of revisions. + + Value Type: INTEGER + + Property Parameters: IANA and non-standard property parameters can + be specified on this property. + + + +Desruisseaux Standards Track [Page 138] + +RFC 5545 iCalendar September 2009 + + + Conformance: The property can be specified in "VEVENT", "VTODO", or + "VJOURNAL" calendar component. + + Description: When a calendar component is created, its sequence + number is 0. It is monotonically incremented by the "Organizer's" + CUA each time the "Organizer" makes a significant revision to the + calendar component. + + The "Organizer" includes this property in an iCalendar object that + it sends to an "Attendee" to specify the current version of the + calendar component. + + The "Attendee" includes this property in an iCalendar object that + it sends to the "Organizer" to specify the version of the calendar + component to which the "Attendee" is referring. + + A change to the sequence number is not the mechanism that an + "Organizer" uses to request a response from the "Attendees". The + "RSVP" parameter on the "ATTENDEE" property is used by the + "Organizer" to indicate that a response from the "Attendees" is + requested. + + Recurrence instances of a recurring component MAY have different + sequence numbers. + + Format Definition: This property is defined by the following + notation: + + seq = "SEQUENCE" seqparam ":" integer CRLF + ; Default is "0" + + seqparam = *(";" other-param) + + Example: The following is an example of this property for a calendar + component that was just created by the "Organizer": + + SEQUENCE:0 + + The following is an example of this property for a calendar + component that has been revised two different times by the + "Organizer": + + SEQUENCE:2 + +3.8.8. Miscellaneous Component Properties + + The following properties specify information about a number of + miscellaneous features of calendar components. + + + +Desruisseaux Standards Track [Page 139] + +RFC 5545 iCalendar September 2009 + + +3.8.8.1. IANA Properties + + Property Name: An IANA-registered property name + + Value Type: The default value type is TEXT. The value type can be + set to any value type. + + Property Parameters: Any parameter can be specified on this + property. + + Description: This specification allows other properties registered + with IANA to be specified in any calendar components. Compliant + applications are expected to be able to parse these other IANA- + registered properties but can ignore them. + + Format Definition: This property is defined by the following + notation: + + iana-prop = iana-token *(";" icalparameter) ":" value CRLF + + Example: The following are examples of properties that might be + registered to IANA: + + DRESSCODE:CASUAL + + NON-SMOKING;VALUE=BOOLEAN:TRUE + +3.8.8.2. Non-Standard Properties + + Property Name: Any property name with a "X-" prefix + + Purpose: This class of property provides a framework for defining + non-standard properties. + + Value Type: The default value type is TEXT. The value type can be + set to any value type. + + Property Parameters: IANA, non-standard, and language property + parameters can be specified on this property. + + Conformance: This property can be specified in any calendar + component. + + Description: The MIME Calendaring and Scheduling Content Type + provides a "standard mechanism for doing non-standard things". + This extension support is provided for implementers to "push the + envelope" on the existing version of the memo. Extension + properties are specified by property and/or property parameter + + + +Desruisseaux Standards Track [Page 140] + +RFC 5545 iCalendar September 2009 + + + names that have the prefix text of "X-" (the two-character + sequence: LATIN CAPITAL LETTER X character followed by the HYPHEN- + MINUS character). It is recommended that vendors concatenate onto + this sentinel another short prefix text to identify the vendor. + This will facilitate readability of the extensions and minimize + possible collision of names between different vendors. User + agents that support this content type are expected to be able to + parse the extension properties and property parameters but can + ignore them. + + At present, there is no registration authority for names of + extension properties and property parameters. The value type for + this property is TEXT. Optionally, the value type can be any of + the other valid value types. + + Format Definition: This property is defined by the following + notation: + + x-prop = x-name *(";" icalparameter) ":" value CRLF + + Example: The following might be the ABC vendor's extension for an + audio-clip form of subject property: + + X-ABC-MMSUBJ;VALUE=URI;FMTTYPE=audio/basic:http://www.example. + org/mysubj.au + +3.8.8.3. Request Status + + Property Name: REQUEST-STATUS + + Purpose: This property defines the status code returned for a + scheduling request. + + Value Type: TEXT + + Property Parameters: IANA, non-standard, and language property + parameters can be specified on this property. + + Conformance: The property can be specified in the "VEVENT", "VTODO", + "VJOURNAL", or "VFREEBUSY" calendar component. + + Description: This property is used to return status code information + related to the processing of an associated iCalendar object. The + value type for this property is TEXT. + + + + + + + +Desruisseaux Standards Track [Page 141] + +RFC 5545 iCalendar September 2009 + + + The value consists of a short return status component, a longer + return status description component, and optionally a status- + specific data component. The components of the value are + separated by the SEMICOLON character. + + The short return status is a PERIOD character separated pair or + 3-tuple of integers. For example, "3.1" or "3.1.1". The + successive levels of integers provide for a successive level of + status code granularity. + + The following are initial classes for the return status code. + Individual iCalendar object methods will define specific return + status codes for these classes. In addition, other classes for + the return status code may be defined using the registration + process defined later in this memo. + + +--------+----------------------------------------------------------+ + | Short | Longer Return Status Description | + | Return | | + | Status | | + | Code | | + +--------+----------------------------------------------------------+ + | 1.xx | Preliminary success. This class of status code | + | | indicates that the request has been initially processed | + | | but that completion is pending. | + | | | + | 2.xx | Successful. This class of status code indicates that | + | | the request was completed successfully. However, the | + | | exact status code can indicate that a fallback has been | + | | taken. | + | | | + | 3.xx | Client Error. This class of status code indicates that | + | | the request was not successful. The error is the result | + | | of either a syntax or a semantic error in the client- | + | | formatted request. Request should not be retried until | + | | the condition in the request is corrected. | + | | | + | 4.xx | Scheduling Error. This class of status code indicates | + | | that the request was not successful. Some sort of error | + | | occurred within the calendaring and scheduling service, | + | | not directly related to the request itself. | + +--------+----------------------------------------------------------+ + + + + + + + + + +Desruisseaux Standards Track [Page 142] + +RFC 5545 iCalendar September 2009 + + + Format Definition: This property is defined by the following + notation: + + rstatus = "REQUEST-STATUS" rstatparam ":" + statcode ";" statdesc [";" extdata] + + rstatparam = *( + ; + ; The following is OPTIONAL, + ; but MUST NOT occur more than once. + ; + (";" languageparam) / + ; + ; The following is OPTIONAL, + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + statcode = 1*DIGIT 1*2("." 1*DIGIT) + ;Hierarchical, numeric return status code + + statdesc = text + ;Textual status description + + extdata = text + ;Textual exception data. For example, the offending property + ;name and value or complete property line. + + Example: The following are some possible examples of this property. + + The COMMA and SEMICOLON separator characters in the property value + are BACKSLASH character escaped because they appear in a text + value. + + REQUEST-STATUS:2.0;Success + + REQUEST-STATUS:3.1;Invalid property value;DTSTART:96-Apr-01 + + REQUEST-STATUS:2.8; Success\, repeating event ignored. Scheduled + as a single event.;RRULE:FREQ=WEEKLY\;INTERVAL=2 + + REQUEST-STATUS:4.1;Event conflict. Date-time is busy. + + REQUEST-STATUS:3.7;Invalid calendar user;ATTENDEE: + mailto:jsmith@example.com + + + + +Desruisseaux Standards Track [Page 143] + +RFC 5545 iCalendar September 2009 + + +4. iCalendar Object Examples + + The following examples are provided as an informational source of + illustrative iCalendar objects consistent with this content type. + + The following example specifies a three-day conference that begins at + 2:30 P.M. UTC, September 18, 1996 and ends at 10:00 P.M. UTC, + September 20, 1996. + + BEGIN:VCALENDAR + PRODID:-//xyz Corp//NONSGML PDA Calendar Version 1.0//EN + VERSION:2.0 + BEGIN:VEVENT + DTSTAMP:19960704T120000Z + UID:uid1@example.com + ORGANIZER:mailto:jsmith@example.com + DTSTART:19960918T143000Z + DTEND:19960920T220000Z + STATUS:CONFIRMED + CATEGORIES:CONFERENCE + SUMMARY:Networld+Interop Conference + DESCRIPTION:Networld+Interop Conference + and Exhibit\nAtlanta World Congress Center\n + Atlanta\, Georgia + END:VEVENT + END:VCALENDAR + + The following example specifies a group-scheduled meeting that begins + at 8:30 AM EST on March 12, 1998 and ends at 9:30 AM EST on March 12, + 1998. The "Organizer" has scheduled the meeting with one or more + calendar users in a group. A time zone specification for Eastern + United States has been specified. + + BEGIN:VCALENDAR + PRODID:-//RDU Software//NONSGML HandCal//EN + VERSION:2.0 + BEGIN:VTIMEZONE + TZID:America/New_York + BEGIN:STANDARD + DTSTART:19981025T020000 + TZOFFSETFROM:-0400 + TZOFFSETTO:-0500 + TZNAME:EST + END:STANDARD + BEGIN:DAYLIGHT + DTSTART:19990404T020000 + TZOFFSETFROM:-0500 + TZOFFSETTO:-0400 + + + +Desruisseaux Standards Track [Page 144] + +RFC 5545 iCalendar September 2009 + + + TZNAME:EDT + END:DAYLIGHT + END:VTIMEZONE + BEGIN:VEVENT + DTSTAMP:19980309T231000Z + UID:guid-1.example.com + ORGANIZER:mailto:mrbig@example.com + ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP: + mailto:employee-A@example.com + DESCRIPTION:Project XYZ Review Meeting + CATEGORIES:MEETING + CLASS:PUBLIC + CREATED:19980309T130000Z + SUMMARY:XYZ Project Review + DTSTART;TZID=America/New_York:19980312T083000 + DTEND;TZID=America/New_York:19980312T093000 + LOCATION:1CP Conference Room 4350 + END:VEVENT + END:VCALENDAR + + The following is an example of an iCalendar object passed in a MIME + message with a single body part consisting of a "text/calendar" + Content Type. + + TO:jsmith@example.com + FROM:jdoe@example.com + MIME-VERSION:1.0 + MESSAGE-ID: + CONTENT-TYPE:text/calendar; method="xyz"; component="VEVENT" + + BEGIN:VCALENDAR + METHOD:xyz + VERSION:2.0 + PRODID:-//ABC Corporation//NONSGML My Product//EN + BEGIN:VEVENT + DTSTAMP:19970324T120000Z + SEQUENCE:0 + UID:uid3@example.com + ORGANIZER:mailto:jdoe@example.com + ATTENDEE;RSVP=TRUE:mailto:jsmith@example.com + DTSTART:19970324T123000Z + DTEND:19970324T210000Z + CATEGORIES:MEETING,PROJECT + CLASS:PUBLIC + SUMMARY:Calendaring Interoperability Planning Meeting + DESCRIPTION:Discuss how we can test c&s interoperability\n + using iCalendar and other IETF standards. + LOCATION:LDB Lobby + + + +Desruisseaux Standards Track [Page 145] + +RFC 5545 iCalendar September 2009 + + + ATTACH;FMTTYPE=application/postscript:ftp://example.com/pub/ + conf/bkgrnd.ps + END:VEVENT + END:VCALENDAR + + The following is an example of a to-do due on April 15, 1998. An + audio alarm has been specified to remind the calendar user at noon, + the day before the to-do is expected to be completed and repeat + hourly, four additional times. The to-do definition has been + modified twice since it was initially created. + + BEGIN:VCALENDAR + VERSION:2.0 + PRODID:-//ABC Corporation//NONSGML My Product//EN + BEGIN:VTODO + DTSTAMP:19980130T134500Z + SEQUENCE:2 + UID:uid4@example.com + ORGANIZER:mailto:unclesam@example.com + ATTENDEE;PARTSTAT=ACCEPTED:mailto:jqpublic@example.com + DUE:19980415T000000 + STATUS:NEEDS-ACTION + SUMMARY:Submit Income Taxes + BEGIN:VALARM + ACTION:AUDIO + TRIGGER:19980403T120000Z + ATTACH;FMTTYPE=audio/basic:http://example.com/pub/audio- + files/ssbanner.aud + REPEAT:4 + DURATION:PT1H + END:VALARM + END:VTODO + END:VCALENDAR + + The following is an example of a journal entry: + + BEGIN:VCALENDAR + VERSION:2.0 + PRODID:-//ABC Corporation//NONSGML My Product//EN + BEGIN:VJOURNAL + DTSTAMP:19970324T120000Z + UID:uid5@example.com + ORGANIZER:mailto:jsmith@example.com + STATUS:DRAFT + CLASS:PUBLIC + CATEGORIES:Project Report,XYZ,Weekly Meeting + DESCRIPTION:Project xyz Review Meeting Minutes\n + Agenda\n1. Review of project version 1.0 requirements.\n2. + + + +Desruisseaux Standards Track [Page 146] + +RFC 5545 iCalendar September 2009 + + + Definition + of project processes.\n3. Review of project schedule.\n + Participants: John Smith\, Jane Doe\, Jim Dandy\n-It was + decided that the requirements need to be signed off by + product marketing.\n-Project processes were accepted.\n + -Project schedule needs to account for scheduled holidays + and employee vacation time. Check with HR for specific + dates.\n-New schedule will be distributed by Friday.\n- + Next weeks meeting is cancelled. No meeting until 3/23. + END:VJOURNAL + END:VCALENDAR + + The following is an example of published busy time information. The + iCalendar object might be placed in the network resource + http://www.example.com/calendar/busytime/jsmith.ifb. + + BEGIN:VCALENDAR + VERSION:2.0 + PRODID:-//RDU Software//NONSGML HandCal//EN + BEGIN:VFREEBUSY + ORGANIZER:mailto:jsmith@example.com + DTSTART:19980313T141711Z + DTEND:19980410T141711Z + FREEBUSY:19980314T233000Z/19980315T003000Z + FREEBUSY:19980316T153000Z/19980316T163000Z + FREEBUSY:19980318T030000Z/19980318T040000Z + URL:http://www.example.com/calendar/busytime/jsmith.ifb + END:VFREEBUSY + END:VCALENDAR + +5. Recommended Practices + + These recommended practices should be followed in order to assure + consistent handling of the following cases for an iCalendar object. + + 1. Content lines longer than 75 octets SHOULD be folded. + + 2. When the combination of the "RRULE" and "RDATE" properties in a + recurring component produces multiple instances having the same + start DATE-TIME value, they should be collapsed to, and + considered as, a single instance. If the "RDATE" property is + specified as a PERIOD value the duration of the recurrence + instance will be the one specified by the "RDATE" property, and + not the duration of the recurrence instance defined by the + "DTSTART" property. + + 3. When a calendar user receives multiple requests for the same + calendar component (e.g., REQUEST for a "VEVENT" calendar + + + +Desruisseaux Standards Track [Page 147] + +RFC 5545 iCalendar September 2009 + + + component) as a result of being on multiple mailing lists + specified by "ATTENDEE" properties in the request, they SHOULD + respond to only one of the requests. The calendar user SHOULD + also specify (using the "MEMBER" parameter of the "ATTENDEE" + property) of which mailing list they are a member. + + 4. An implementation can truncate a "SUMMARY" property value to 255 + octets, but it MUST NOT truncate the value in the middle of a + UTF-8 multi-octet sequence. + + 5. If seconds of the minute are not supported by an implementation, + then a value of "00" SHOULD be specified for the seconds + component in a time value. + + 6. "TZURL" values SHOULD NOT be specified as a file URI type. This + URI form can be useful within an organization, but is problematic + in the Internet. + + 7. Some possible English values for "CATEGORIES" property include: + "ANNIVERSARY", "APPOINTMENT", "BUSINESS", "EDUCATION", "HOLIDAY", + "MEETING", "MISCELLANEOUS", "NON-WORKING HOURS", "NOT IN OFFICE", + "PERSONAL", "PHONE CALL", "SICK DAY", "SPECIAL OCCASION", + "TRAVEL", "VACATION". Categories can be specified in any + registered language. + + 8. Some possible English values for the "RESOURCES" property + include: "CATERING", "CHAIRS", "COMPUTER PROJECTOR", "EASEL", + "OVERHEAD PROJECTOR", "SPEAKER PHONE", "TABLE", "TV", "VCR", + "VIDEO PHONE", "VEHICLE". Resources can be specified in any + registered language. + +6. Internationalization Considerations + + Applications MUST generate iCalendar streams in the UTF-8 charset and + MUST accept an iCalendar stream in the UTF-8 or US-ASCII charset. + +7. Security Considerations + + Because calendaring and scheduling information is very privacy- + sensitive, the protocol used for the transmission of calendaring and + scheduling information should have capabilities to protect the + information from possible threats, such as eavesdropping, replay, + message insertion, deletion, modification, and man-in-the-middle + attacks. + + As this document only defines the data format and media type of text/ + calendar that is independent of any calendar service or protocol, it + is up to the actual protocol specifications such as iTIP [2446bis], + + + +Desruisseaux Standards Track [Page 148] + +RFC 5545 iCalendar September 2009 + + + iMIP [2447bis], and "Calendaring Extensions to WebDAV (CalDAV)" + [RFC4791] to describe the threats that the above attacks present, as + well as ways in which to mitigate them. + +8. IANA Considerations + +8.1. iCalendar Media Type Registration + + The Calendaring and Scheduling Core Object Specification is intended + for use as a MIME content type. + + To: ietf-types@iana.org + + Subject: Registration of media type text/calendar + + Type name: text + + Subtype name: calendar + + Required parameters: none + + Optional parameters: charset, method, component, and optinfo + + The "charset" parameter is defined in [RFC2046] for subtypes of + the "text" media type. It is used to indicate the charset used in + the body part. The charset supported by this revision of + iCalendar is UTF-8. The use of any other charset is deprecated by + this revision of iCalendar; however, note that this revision + requires that compliant applications MUST accept iCalendar streams + using either the UTF-8 or US-ASCII charset. + + The "method" parameter is used to convey the iCalendar object + method or transaction semantics for the calendaring and scheduling + information. It also is an identifier for the restricted set of + properties and values of which the iCalendar object consists. The + parameter is to be used as a guide for applications interpreting + the information contained within the body part. It SHOULD NOT be + used to exclude or require particular pieces of information unless + the identified method definition specifically calls for this + behavior. Unless specifically forbidden by a particular method + definition, a text/calendar content type can contain any set of + properties permitted by the Calendaring and Scheduling Core Object + Specification. The "method" parameter MUST be specified and MUST + be set to the same value as the "METHOD" component property of the + iCalendar objects of the iCalendar stream if and only if the + iCalendar objects in the iCalendar stream all have a "METHOD" + component property set to the same value. + + + + +Desruisseaux Standards Track [Page 149] + +RFC 5545 iCalendar September 2009 + + + The value for the "method" parameter is defined as follows: + + method = 1*(ALPHA / DIGIT / "-") + ; IANA-registered iCalendar object method + + The "component" parameter conveys the type of iCalendar calendar + component within the body part. If the iCalendar object contains + more than one calendar component type, then multiple component + parameters MUST be specified. + + The value for the "component" parameter is defined as follows: + + component = "VEVENT" + / "VTODO" + / "VJOURNAL" + / "VFREEBUSY" + / "VTIMEZONE" + / iana-token + / x-name + + The "optinfo" parameter conveys optional information about the + iCalendar object within the body part. This parameter can only + specify semantics already specified by the iCalendar object and + that can be otherwise determined by parsing the body part. In + addition, the optional information specified by this parameter + MUST be consistent with that information specified by the + iCalendar object. For example, it can be used to convey the + "Attendee" response status to a meeting request. The parameter + value consists of a string value. + + The parameter can be specified multiple times. + + The value for the "optinfo" parameter is defined as follows: + + optinfo = infovalue / qinfovalue + + infovalue = iana-token / x-name + + qinfovalue = DQUOTE (infovalue) DQUOTE + + Encoding considerations: This media type can contain 8bit + characters, so the use of quoted-printable or base64 MIME Content- + Transfer-Encodings might be necessary when iCalendar objects are + transferred across protocols restricted to the 7bit repertoire. + Note that a text valued property in the content entity can also + have content encoding of special characters using a BACKSLASH + character escapement technique. This means that content values + can end up being encoded twice. + + + +Desruisseaux Standards Track [Page 150] + +RFC 5545 iCalendar September 2009 + + + Security considerations: See Section 7. + + Interoperability considerations: This media type is intended to + define a common format for conveying calendaring and scheduling + information between different systems. It is heavily based on the + earlier [VCAL] industry specification. + + Published specification: This specification. + + Applications that use this media type: This media type is designed + for widespread use by Internet calendaring and scheduling + applications. In addition, applications in the workflow and + document management area might find this content-type applicable. + The iTIP [2446bis], iMIP [2447bis], and CalDAV [RFC4791] Internet + protocols directly use this media type also. + + Additional information: + + Magic number(s): None. + + File extension(s): The file extension of "ics" is to be used to + designate a file containing (an arbitrary set of) calendaring + and scheduling information consistent with this MIME content + type. + + The file extension of "ifb" is to be used to designate a file + containing free or busy time information consistent with this + MIME content type. + + Macintosh file type code(s): The file type code of "iCal" is to + be used in Apple MacIntosh operating system environments to + designate a file containing calendaring and scheduling + information consistent with this MIME media type. + + The file type code of "iFBf" is to be used in Apple MacIntosh + operating system environments to designate a file containing + free or busy time information consistent with this MIME media + type. + + Person & email address to contact for further information: See the + "Author's Address" section of this document. + + Intended usage: COMMON + + Restrictions on usage: There are no restrictions on where this media + type can be used. + + Author: See the "Author's Address" section of this document. + + + +Desruisseaux Standards Track [Page 151] + +RFC 5545 iCalendar September 2009 + + + Change controller: IETF + +8.2. New iCalendar Elements Registration + + This section defines the process to register new or modified + iCalendar elements, that is, components, properties, parameters, + value data types, and values, with IANA. + +8.2.1. iCalendar Elements Registration Procedure + + The IETF will create a mailing list, icalendar@ietf.org, which can be + used for public discussion of iCalendar elements proposals prior to + registration. Use of the mailing list is strongly encouraged. The + IESG will appoint a designated expert who will monitor the + icalendar@ietf.org mailing list and review registrations. + + Registration of new iCalendar elements MUST be reviewed by the + designated expert and published in an RFC. A Standards Track RFC is + REQUIRED for the registration of new value data types that modify + existing properties, as well as for the registration of participation + status values to be used in "VEVENT" calendar components. A + Standards Track RFC is also REQUIRED for registration of iCalendar + elements that modify iCalendar elements previously documented in a + Standards Track RFC. + + The registration procedure begins when a completed registration + template, defined in the sections below, is sent to + icalendar@ietf.org and iana@iana.org. The designated expert is + expected to tell IANA and the submitter of the registration within + two weeks whether the registration is approved, approved with minor + changes, or rejected with cause. When a registration is rejected + with cause, it can be re-submitted if the concerns listed in the + cause are addressed. Decisions made by the designated expert can be + appealed to the IESG Applications Area Director, then to the IESG. + They follow the normal appeals procedure for IESG decisions. + +8.2.2. Registration Template for Components + + A component is defined by completing the following template. + + Component name: The name of the component. + + Purpose: The purpose of the component. Give a short but clear + description. + + Format definition: The ABNF for the component definition needs to be + specified. + + + + +Desruisseaux Standards Track [Page 152] + +RFC 5545 iCalendar September 2009 + + + Description: Any special notes about the component, how it is to be + used, etc. + + Example(s): One or more examples of instances of the component need + to be specified. + +8.2.3. Registration Template for Properties + + A property is defined by completing the following template. + + Property name: The name of the property. + + Purpose: The purpose of the property. Give a short but clear + description. + + Value type: Any of the valid value types for the property value need + to be specified. The default value type also needs to be + specified. + + Property parameters: Any of the valid property parameters for the + property MUST be specified. + + Conformance: The calendar components in which the property can + appear MUST be specified. + + Description: Any special notes about the property, how it is to be + used, etc. + + Format definition: The ABNF for the property definition needs to be + specified. + + Example(s): One or more examples of instances of the property need + to be specified. + +8.2.4. Registration Template for Parameters + + A parameter is defined by completing the following template. + + Parameter name: The name of the parameter. + + Purpose: The purpose of the parameter. Give a short but clear + description. + + Format definition: The ABNF for the parameter definition needs to be + specified. + + Description: Any special notes about the parameter, how it is to be + used, etc. + + + +Desruisseaux Standards Track [Page 153] + +RFC 5545 iCalendar September 2009 + + + Example(s): One or more examples of instances of the parameter need + to be specified. + +8.2.5. Registration Template for Value Data Types + + A value data type is defined by completing the following template. + + Value name: The name of the value type. + + Purpose: The purpose of the value type. Give a short but clear + description. + + Format definition: The ABNF for the value type definition needs to + be specified. + + Description: Any special notes about the value type, how it is to be + used, etc. + + Example(s): One or more examples of instances of the value type need + to be specified. + +8.2.6. Registration Template for Values + + A value is defined by completing the following template. + + Value: The value literal. + + Purpose: The purpose of the value. Give a short but clear + description. + + Conformance: The calendar properties and/or parameters that can take + this value need to be specified. + + Example(s): One or more examples of instances of the value need to + be specified. + + The following is a fictitious example of a registration of an + iCalendar value: + + Value: TOP-SECRET + + Purpose: This value is used to specify the access classification of + top-secret calendar components. + + Conformance: This value can be used with the "CLASS" property. + + + + + + +Desruisseaux Standards Track [Page 154] + +RFC 5545 iCalendar September 2009 + + + Example(s): The following is an example of this value used with the + "CLASS" property: + + CLASS:TOP-SECRET + +8.3. Initial iCalendar Elements Registries + + The IANA created and maintains the following registries for iCalendar + elements with pointers to appropriate reference documents. + +8.3.1. Components Registry + + The following table has been used to initialize the components + registry. + + +-----------+---------+-------------------------+ + | Component | Status | Reference | + +-----------+---------+-------------------------+ + | VCALENDAR | Current | RFC 5545, Section 3.4 | + | | | | + | VEVENT | Current | RFC 5545, Section 3.6.1 | + | | | | + | VTODO | Current | RFC 5545, Section 3.6.2 | + | | | | + | VJOURNAL | Current | RFC 5545, Section 3.6.3 | + | | | | + | VFREEBUSY | Current | RFC 5545, Section 3.6.4 | + | | | | + | VTIMEZONE | Current | RFC 5545, Section 3.6.5 | + | | | | + | VALARM | Current | RFC 5545, Section 3.6.6 | + | | | | + | STANDARD | Current | RFC 5545, Section 3.6.5 | + | | | | + | DAYLIGHT | Current | RFC 5545, Section 3.6.5 | + +-----------+---------+-------------------------+ + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 155] + +RFC 5545 iCalendar September 2009 + + +8.3.2. Properties Registry + + The following table is has been used to initialize the properties + registry. + + +------------------+------------+----------------------------+ + | Property | Status | Reference | + +------------------+------------+----------------------------+ + | CALSCALE | Current | RFC 5545, Section 3.7.1 | + | METHOD | Current | RFC 5545, Section 3.7.2 | + | | | | + | PRODID | Current | RFC 5545, Section 3.7.3 | + | | | | + | VERSION | Current | RFC 5545, Section 3.7.4 | + | | | | + | ATTACH | Current | RFC 5545, Section 3.8.1.1 | + | | | | + | CATEGORIES | Current | RFC 5545, Section 3.8.1.2 | + | | | | + | CLASS | Current | RFC 5545, Section 3.8.1.3 | + | | | | + | COMMENT | Current | RFC 5545, Section 3.8.1.4 | + | | | | + | DESCRIPTION | Current | RFC 5545, Section 3.8.1.5 | + | | | | + | GEO | Current | RFC 5545, Section 3.8.1.6 | + | | | | + | LOCATION | Current | RFC 5545, Section 3.8.1.7 | + | | | | + | PERCENT-COMPLETE | Current | RFC 5545, Section 3.8.1.8 | + | | | | + | PRIORITY | Current | RFC 5545, Section 3.8.1.9 | + | | | | + | RESOURCES | Current | RFC 5545, Section 3.8.1.10 | + | | | | + | STATUS | Current | RFC 5545, Section 3.8.1.11 | + | | | | + | SUMMARY | Current | RFC 5545, Section 3.8.1.12 | + | | | | + | COMPLETED | Current | RFC 5545, Section 3.8.2.1 | + | | | | + | DTEND | Current | RFC 5545, Section 3.8.2.2 | + | | | | + | DUE | Current | RFC 5545, Section 3.8.2.3 | + | | | | + | DTSTART | Current | RFC 5545, Section 3.8.2.4 | + | | | | + | DURATION | Current | RFC 5545, Section 3.8.2.5 | + + + +Desruisseaux Standards Track [Page 156] + +RFC 5545 iCalendar September 2009 + + + | | | | + | FREEBUSY | Current | RFC 5545, Section 3.8.2.6 | + | | | | + | TRANSP | Current | RFC 5545, Section 3.8.2.7 | + | | | | + | TZID | Current | RFC 5545, Section 3.8.3.1 | + | | | | + | TZNAME | Current | RFC 5545, Section 3.8.3.2 | + | | | | + | TZOFFSETFROM | Current | RFC 5545, Section 3.8.3.3 | + | | | | + | TZOFFSETTO | Current | RFC 5545, Section 3.8.3.4 | + | | | | + | TZURL | Current | RFC 5545, Section 3.8.3.5 | + | | | | + | ATTENDEE | Current | RFC 5545, Section 3.8.4.1 | + | | | | + | CONTACT | Current | RFC 5545, Section 3.8.4.2 | + | | | | + | ORGANIZER | Current | RFC 5545, Section 3.8.4.3 | + | | | | + | RECURRENCE-ID | Current | RFC 5545, Section 3.8.4.4 | + | | | | + | RELATED-TO | Current | RFC 5545, Section 3.8.4.5 | + | | | | + | URL | Current | RFC 5545, Section 3.8.4.6 | + | | | | + | UID | Current | RFC 5545, Section 3.8.4.7 | + | | | | + | EXDATE | Current | RFC 5545, Section 3.8.5.1 | + | | | | + | EXRULE | Deprecated | [RFC2445], Section 4.8.5.2 | + | | | | + | RDATE | Current | RFC 5545, Section 3.8.5.2 | + | | | | + | RRULE | Current | RFC 5545, Section 3.8.5.3 | + | | | | + | ACTION | Current | RFC 5545, Section 3.8.6.1 | + | | | | + | REPEAT | Current | RFC 5545, Section 3.8.6.2 | + | | | | + | TRIGGER | Current | RFC 5545, Section 3.8.6.3 | + | | | | + | CREATED | Current | RFC 5545, Section 3.8.7.1 | + | | | | + | DTSTAMP | Current | RFC 5545, Section 3.8.7.2 | + | | | | + | LAST-MODIFIED | Current | RFC 5545, Section 3.8.7.3 | + + + +Desruisseaux Standards Track [Page 157] + +RFC 5545 iCalendar September 2009 + + + | | | | + | SEQUENCE | Current | RFC 5545, Section 3.8.7.4 | + | | | | + | REQUEST-STATUS | Current | RFC 5545, Section 3.8.8.3 | + +------------------+------------+----------------------------+ + +8.3.3. Parameters Registry + + The following table has been used to initialize the parameters + registry. + + +----------------+---------+--------------------------+ + | Parameter | Status | Reference | + +----------------+---------+--------------------------+ + | ALTREP | Current | RFC 5545, Section 3.2.1 | + | | | | + | CN | Current | RFC 5545, Section 3.2.2 | + | | | | + | CUTYPE | Current | RFC 5545, Section 3.2.3 | + | | | | + | DELEGATED-FROM | Current | RFC 5545, Section 3.2.4 | + | | | | + | DELEGATED-TO | Current | RFC 5545, Section 3.2.5 | + | | | | + | DIR | Current | RFC 5545, Section 3.2.6 | + | | | | + | ENCODING | Current | RFC 5545, Section 3.2.7 | + | | | | + | FMTTYPE | Current | RFC 5545, Section 3.2.8 | + | | | | + | FBTYPE | Current | RFC 5545, Section 3.2.9 | + | | | | + | LANGUAGE | Current | RFC 5545, Section 3.2.10 | + | | | | + | MEMBER | Current | RFC 5545, Section 3.2.11 | + | | | | + | PARTSTAT | Current | RFC 5545, Section 3.2.12 | + | | | | + | RANGE | Current | RFC 5545, Section 3.2.13 | + | | | | + | RELATED | Current | RFC 5545, Section 3.2.14 | + | | | | + | RELTYPE | Current | RFC 5545, Section 3.2.15 | + | | | | + | ROLE | Current | RFC 5545, Section 3.2.16 | + | | | | + | RSVP | Current | RFC 5545, Section 3.2.17 | + | | | | + + + +Desruisseaux Standards Track [Page 158] + +RFC 5545 iCalendar September 2009 + + + | SENT-BY | Current | RFC 5545, Section 3.2.18 | + | | | | + | TZID | Current | RFC 5545, Section 3.2.19 | + | | | | + | VALUE | Current | RFC 5545, Section 3.2.20 | + +----------------+---------+--------------------------+ + +8.3.4. Value Data Types Registry + + The following table has been used to initialize the value data types + registry. + + +-----------------+---------+--------------------------+ + | Value Data Type | Status | Reference | + +-----------------+---------+--------------------------+ + | BINARY | Current | RFC 5545, Section 3.3.1 | + | | | | + | BOOLEAN | Current | RFC 5545, Section 3.3.2 | + | | | | + | CAL-ADDRESS | Current | RFC 5545, Section 3.3.3 | + | | | | + | DATE | Current | RFC 5545, Section 3.3.4 | + | | | | + | DATE-TIME | Current | RFC 5545, Section 3.3.5 | + | | | | + | DURATION | Current | RFC 5545, Section 3.3.6 | + | | | | + | FLOAT | Current | RFC 5545, Section 3.3.7 | + | | | | + | INTEGER | Current | RFC 5545, Section 3.3.8 | + | | | | + | PERIOD | Current | RFC 5545, Section 3.3.9 | + | | | | + | RECUR | Current | RFC 5545, Section 3.3.10 | + | | | | + | TEXT | Current | RFC 5545, Section 3.3.11 | + | | | | + | TIME | Current | RFC 5545, Section 3.3.12 | + | | | | + | URI | Current | RFC 5545, Section 3.3.13 | + | | | | + | UTC-OFFSET | Current | RFC 5545, Section 3.3.14 | + +-----------------+---------+--------------------------+ + + + + + + + + +Desruisseaux Standards Track [Page 159] + +RFC 5545 iCalendar September 2009 + + +8.3.5. Calendar User Types Registry + + The following table has been used to initialize the calendar user + types registry. + + +--------------------+---------+-------------------------+ + | Calendar User Type | Status | Reference | + +--------------------+---------+-------------------------+ + | INDIVIDUAL | Current | RFC 5545, Section 3.2.3 | + | | | | + | GROUP | Current | RFC 5545, Section 3.2.3 | + | | | | + | RESOURCE | Current | RFC 5545, Section 3.2.3 | + | | | | + | ROOM | Current | RFC 5545, Section 3.2.3 | + | | | | + | UNKNOWN | Current | RFC 5545, Section 3.2.3 | + +--------------------+---------+-------------------------+ + +8.3.6. Free/Busy Time Types Registry + + The following table has been used to initialize the free/busy time + types registry. + + +---------------------+---------+-------------------------+ + | Free/Busy Time Type | Status | Reference | + +---------------------+---------+-------------------------+ + | FREE | Current | RFC 5545, Section 3.2.9 | + | | | | + | BUSY | Current | RFC 5545, Section 3.2.9 | + | | | | + | BUSY-UNAVAILABLE | Current | RFC 5545, Section 3.2.9 | + | | | | + | BUSY-TENTATIVE | Current | RFC 5545, Section 3.2.9 | + +---------------------+---------+-------------------------+ + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 160] + +RFC 5545 iCalendar September 2009 + + +8.3.7. Participation Statuses Registry + + The following table has been used to initialize the participation + statuses registry. + + +--------------------+---------+--------------------------+ + | Participant Status | Status | Reference | + +--------------------+---------+--------------------------+ + | NEEDS-ACTION | Current | RFC 5545, Section 3.2.12 | + | | | | + | ACCEPTED | Current | RFC 5545, Section 3.2.12 | + | | | | + | DECLINED | Current | RFC 5545, Section 3.2.12 | + | | | | + | TENTATIVE | Current | RFC 5545, Section 3.2.12 | + | | | | + | DELEGATED | Current | RFC 5545, Section 3.2.12 | + | | | | + | COMPLETED | Current | RFC 5545, Section 3.2.12 | + | | | | + | IN-PROCESS | Current | RFC 5545, Section 3.2.12 | + +--------------------+---------+--------------------------+ + +8.3.8. Relationship Types Registry + + The following table has been used to initialize the relationship + types registry. + + +-------------------+---------+--------------------------+ + | Relationship Type | Status | Reference | + +-------------------+---------+--------------------------+ + | CHILD | Current | RFC 5545, Section 3.2.15 | + | | | | + | PARENT | Current | RFC 5545, Section 3.2.15 | + | | | | + | SIBLING | Current | RFC 5545, Section 3.2.15 | + +-------------------+---------+--------------------------+ + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 161] + +RFC 5545 iCalendar September 2009 + + +8.3.9. Participation Roles Registry + + The following table has been used to initialize the participation + roles registry. + + +-----------------+---------+--------------------------+ + | Role Type | Status | Reference | + +-----------------+---------+--------------------------+ + | CHAIR | Current | RFC 5545, Section 3.2.16 | + | | | | + | REQ-PARTICIPANT | Current | RFC 5545, Section 3.2.16 | + | | | | + | OPT-PARTICIPANT | Current | RFC 5545, Section 3.2.16 | + | | | | + | NON-PARTICIPANT | Current | RFC 5545, Section 3.2.16 | + +-----------------+---------+--------------------------+ + +8.3.10. Actions Registry + + The following table has been used to initialize the actions registry. + + +-----------+------------+----------------------------+ + | Action | Status | Reference | + +-----------+------------+----------------------------+ + | AUDIO | Current | RFC 5545, Section 3.8.6.1 | + | | | | + | DISPLAY | Current | RFC 5545, Section 3.8.6.1 | + | | | | + | EMAIL | Current | RFC 5545, Section 3.8.6.1 | + | | | | + | PROCEDURE | Deprecated | [RFC2445], Section 4.8.6.1 | + +-----------+------------+----------------------------+ + +8.3.11. Classifications Registry + + The following table has been used to initialize the classifications + registry. + + +----------------+---------+---------------------------+ + | Classification | Status | Reference | + +----------------+---------+---------------------------+ + | PUBLIC | Current | RFC 5545, Section 3.8.1.3 | + | | | | + | PRIVATE | Current | RFC 5545, Section 3.8.1.3 | + | | | | + | CONFIDENTIAL | Current | RFC 5545, Section 3.8.1.3 | + +----------------+---------+---------------------------+ + + + + +Desruisseaux Standards Track [Page 162] + +RFC 5545 iCalendar September 2009 + + +8.3.12. Methods Registry + + No values are defined in this document for the "METHOD" property. + +9. Acknowledgments + + The editor of this document wishes to thank Frank Dawson and Derik + Stenerson, the original authors of RFC 2445, as well as the following + individuals who have participated in the drafting, review, and + discussion of this memo: + + Joe Abley, Hervey Allen, Steve Allen, Jay Batson, Oliver Block, + Stephane Bortzmeyer, Chris Bryant, Tantek Celik, Mark Crispin, Cyrus + Daboo, Mike Douglass, Andrew N. Dowden, Lisa Dusseault, Lars Eggert, + Gren Eliot, Pasi Eronen, Ben Fortuna, Ned Freed, Neal Gafter, Ted + Hardie, Tim Hare, Jeffrey Harris, Helge Hess, Paul B. Hill, Thomas + Hnetila, Russ Housley, Leif Johansson, Ciny Joy, Bruce Kahn, Reinhold + Kainhofer, Martin Kiff, Patrice Lapierre, Michiel van Leeuwen, + Jonathan Lennox, Jeff McCullough, Bill McQuillan, Alexey Melnikov, + John W. Noerenberg II, Chuck Norris, Mark Paterson, Simon Pilette, + Arnaud Quillaud, Robert Ransdell, Julian F. Reschke, Caleb + Richardson, Sam Roberts, Dan Romascanu, Mike Samuel, George Sexton, + Nigel Swinson, Clint Talbert, Simon Vaillancourt, Magnus Westerlund, + and Sandy Wills. + + A special thanks to the working group chairs Aki Niemi and Eliot Lear + for their support and guidance. + + The editor would also like to thank the Calendaring and Scheduling + Consortium for advice with this specification, and for organizing + interoperability testing events to help refine it. + + + + + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 163] + +RFC 5545 iCalendar September 2009 + + +10. References + +10.1. Normative References + + [ISO.8601.2004] International Organization for + Standardization, "Data elements and + interchange formats -- Information interchange + -- Representation of dates and times", 2004. + + [ISO.9070.1991] International Organization for + Standardization, "Information Technology_SGML + Support Facilities -- Registration Procedures + for Public Text Owner Identifiers, Second + Edition", April 1991. + + [RFC2045] Freed, N. and N. Borenstein, "Multipurpose + Internet Mail Extensions (MIME) Part One: + Format of Internet Message Bodies", RFC 2045, + November 1996. + + [RFC2046] Freed, N. and N. Borenstein, "Multipurpose + Internet Mail Extensions (MIME) Part Two: + Media Types", RFC 2046, November 1996. + + [RFC2119] Bradner, S., "Key words for use in RFCs to + Indicate Requirement Levels", BCP 14, + RFC 2119, March 1997. + + [RFC2368] Hoffman, P., Masinter, L., and J. Zawinski, + "The mailto URL scheme", RFC 2368, July 1998. + + [RFC3629] Yergeau, F., "UTF-8, a transformation format + of ISO 10646", STD 63, RFC 3629, + November 2003. + + [RFC3986] Berners-Lee, T., Fielding, R., and L. + Masinter, "Uniform Resource Identifier (URI): + Generic Syntax", STD 66, RFC 3986, + January 2005. + + [RFC4288] Freed, N. and J. Klensin, "Media Type + Specifications and Registration Procedures", + BCP 13, RFC 4288, December 2005. + + [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 + Data Encodings", RFC 4648, October 2006. + + + + + +Desruisseaux Standards Track [Page 164] + +RFC 5545 iCalendar September 2009 + + + [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for + Syntax Specifications: ABNF", STD 68, + RFC 5234, January 2008. + + [RFC5646] Phillips, A., Ed., and M. Davis, Ed., "Tags + for Identifying Languages", BCP 47, RFC 5646, + September 2009. + + [US-ASCII] American National Standards Institute, "Coded + Character Set - 7-bit American Standard Code + for Information Interchange", ANSI X3.4, 1986. + +10.2. Informative References + + [2446bis] Daboo, C., "iCalendar Transport-Independent + Interoperability Protocol (iTIP)", Work + in Progress, April 2009. + + [2447bis] Melnikov, A., "iCalendar Message-Based + Interoperability Protocol (iMIP)", Work + in Progress, June 2008. + + [ANSI INCITS 61-1986] International Committee for Information + Technology, "Representation of Geographic + Point Locations for Information Interchange + (formerly ANSI X3.61-1986 (R1997))", ANSI + INCITS 61-1986 (R2007), 2007. + + [RFC1738] Berners-Lee, T., Masinter, L., and M. + McCahill, "Uniform Resource Locators (URL)", + RFC 1738, December 1994. + + [RFC2392] Levinson, E., "Content-ID and Message-ID + Uniform Resource Locators", RFC 2392, + August 1998. + + [RFC2397] Masinter, L., "The "data" URL scheme", + RFC 2397, August 1998. + + [RFC2425] Howes, T., Smith, M., and F. Dawson, "A MIME + Content-Type for Directory Information", + RFC 2425, September 1998. + + [RFC2426] Dawson, F. and T. Howes, "vCard MIME Directory + Profile", RFC 2426, September 1998. + + + + + + +Desruisseaux Standards Track [Page 165] + +RFC 5545 iCalendar September 2009 + + + [RFC2445] Dawson, F. and Stenerson, D., "Internet + Calendaring and Scheduling Core Object + Specification (iCalendar)", RFC 2445, + November 1998. + + [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, + H., Masinter, L., Leach, P., and T. Berners- + Lee, "Hypertext Transfer Protocol -- + HTTP/1.1", RFC 2616, June 1999. + + [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, + May 2000. + + [RFC4516] Smith, M. and T. Howes, "Lightweight Directory + Access Protocol (LDAP): Uniform Resource + Locator", RFC 4516, June 2006. + + [RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault, + "Calendaring Extensions to WebDAV (CalDAV)", + RFC 4791, March 2007. + + [TZDB] Eggert, P. and A.D. Olson, "Sources for Time + Zone and Daylight Saving Time Data", + July 2009, + . + + [VCAL] Internet Mail Consortium, "vCalendar: The + Electronic Calendaring and Scheduling Exchange + Format", September 1996, + . + + + + + + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 166] + +RFC 5545 iCalendar September 2009 + + +Appendix A. Differences from RFC 2445 + + This appendix contains a list of changes that have been made in the + Internet Calendaring and Scheduling Core Object Specification from + RFC 2445. + +A.1. New Restrictions + + 1. The "DTSTART" property SHOULD be synchronized with the recurrence + rule, if specified. + + 2. The "RRULE" property SHOULD NOT occur more than once in a + component. + + 3. The BYHOUR, BYMINUTE, and BYSECOND rule parts MUST NOT be + specified in the "RRULE" property when the "DTSTART" property is + specified as a DATE value. + + 4. The value type of the "DTEND" or "DUE" properties MUST match the + value type of "DTSTART" property. + + 5. The "DURATION" property can no longer appear in "VFREEBUSY" + components. + +A.2. Restrictions Removed + + 1. The "DTSTART" and "DTEND" properties are no longer required to be + specified as date with local time and time zone reference when + used with a recurrence rule. + +A.3. Deprecated Features + + 1. The "EXRULE" property can no longer be specified in a component. + + 2. The "THISANDPRIOR" value can no longer be used with the "RANGE" + parameter. + + 3. The "PROCEDURE" value can no longer be used with the "ACTION" + property. + + 4. The value type RECUR no longer allows multiple values to be + specified by a COMMA-separated list of values. + + 5. x-name rule parts can no longer be specified in properties of + RECUR value type (e.g., "RRULE"). x-param can be used on RECUR + value type properties instead. + + + + + +Desruisseaux Standards Track [Page 167] + +RFC 5545 iCalendar September 2009 + + +Author's Address + + Bernard Desruisseaux (editor) + Oracle Corporation + 600 blvd. de Maisonneuve West + Suite 1900 + Montreal, QC H3A 3J2 + CANADA + + EMail: bernard.desruisseaux@oracle.com + URI: http://www.oracle.com/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Desruisseaux Standards Track [Page 168] + diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc7303-xml-media-types.txt b/docs/research/non-pdf-dom-evidence/standards/rfc7303-xml-media-types.txt new file mode 100644 index 000000000..a6ebdd04e --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc7303-xml-media-types.txt @@ -0,0 +1,1963 @@ + + + + + + +Internet Engineering Task Force (IETF) H. Thompson +Request for Comments: 7303 University of Edinburgh +Obsoletes: 3023 C. Lilley +Updates: 6839 W3C +Category: Standards Track July 2014 +ISSN: 2070-1721 + + + XML Media Types + +Abstract + + This specification standardizes three media types -- application/xml, + application/xml-external-parsed-entity, and application/xml-dtd -- + for use in exchanging network entities that are related to the + Extensible Markup Language (XML) while defining text/xml and text/ + xml-external-parsed-entity as aliases for the respective application/ + types. This specification also standardizes the '+xml' suffix for + naming media types outside of these five types when those media types + represent XML MIME entities. + +Status of This Memo + + This is an Internet Standards Track document. + + This document is a product of the Internet Engineering Task Force + (IETF). It represents the consensus of the IETF community. It has + received public review and has been approved for publication by the + Internet Engineering Steering Group (IESG). Further information on + Internet Standards is available in Section 2 of RFC 5741. + + Information about the current status of this document, any errata, + and how to provide feedback on it may be obtained at + http://www.rfc-editor.org/info/rfc7303. + + + + + + + + + + + + + + + + + +Thompson & Lilley Standards Track [Page 1] + +RFC 7303 XML Media Types July 2014 + + +Copyright Notice + + Copyright (c) 2014 IETF Trust and the persons identified as the + document authors. All rights reserved. + + This document is subject to BCP 78 and the IETF Trust's Legal + Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info) in effect on the date of + publication of this document. Please review these documents + carefully, as they describe your rights and restrictions with respect + to this document. Code Components extracted from this document must + include Simplified BSD License text as described in Section 4.e of + the Trust Legal Provisions and are provided without warranty as + described in the Simplified BSD License. + + This document may contain material from IETF Documents or IETF + Contributions published or made publicly available before November + 10, 2008. The person(s) controlling the copyright in some of this + material may not have granted the IETF Trust the right to allow + modifications of such material outside the IETF Standards Process. + Without obtaining an adequate license from the person(s) controlling + the copyright in such materials, this document may not be modified + outside the IETF Standards Process, and derivative works of it may + not be created outside the IETF Standards Process, except to format + it for publication as an RFC or to translate it into languages other + than English. + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 + 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 4 + 2.1. Requirements Language . . . . . . . . . . . . . . . . . . 4 + 2.2. Characters, Encodings, Charsets . . . . . . . . . . . . . 4 + 2.3. MIME Entities, XML Entities . . . . . . . . . . . . . . . 5 + 3. Encoding Considerations . . . . . . . . . . . . . . . . . . . 6 + 3.1. XML MIME Producers . . . . . . . . . . . . . . . . . . . 6 + 3.2. XML MIME Consumers . . . . . . . . . . . . . . . . . . . 7 + 3.3. The BOM and Encoding Conversions . . . . . . . . . . . . 8 + 4. XML Media Types . . . . . . . . . . . . . . . . . . . . . . . 9 + 4.1. XML MIME Entities . . . . . . . . . . . . . . . . . . . . 9 + 4.2. Using '+xml' when Registering XML-Based Media Types . . . 11 + 4.3. Registration Guidelines for XML-Based Media Types Not + Using '+xml' . . . . . . . . . . . . . . . . . . . . . 12 + 5. Fragment Identifiers . . . . . . . . . . . . . . . . . . . . 13 + 6. The Base URI . . . . . . . . . . . . . . . . . . . . . . . . 14 + 7. XML Versions . . . . . . . . . . . . . . . . . . . . . . . . 14 + 8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 14 + 8.1. UTF-8 Charset . . . . . . . . . . . . . . . . . . . . . . 15 + + + +Thompson & Lilley Standards Track [Page 2] + +RFC 7303 XML Media Types July 2014 + + + 8.2. UTF-16 Charset . . . . . . . . . . . . . . . . . . . . . 16 + 8.3. Omitted Charset and 8-Bit MIME Entity . . . . . . . . . . 16 + 8.4. Omitted Charset and 16-Bit MIME Entity . . . . . . . . . 16 + 8.5. Omitted Charset, No Internal Encoding Declaration . . . . 17 + 8.6. UTF-16BE Charset . . . . . . . . . . . . . . . . . . . . 17 + 8.7. Non-UTF Charset . . . . . . . . . . . . . . . . . . . . . 18 + 8.8. INCONSISTENT EXAMPLE: Conflicting Charset and Internal + Encoding Declaration . . . . . . . . . . . . . . . . . . 18 + 8.9. INCONSISTENT EXAMPLE: Conflicting Charset and BOM . . . . 18 + 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 + 9.1. application/xml Registration . . . . . . . . . . . . . . 19 + 9.2. text/xml Registration . . . . . . . . . . . . . . . . . . 21 + 9.3. application/xml-external-parsed-entity Registration . . . 21 + 9.4. text/xml-external-parsed-entity Registration . . . . . . 22 + 9.5. application/xml-dtd Registration . . . . . . . . . . . . 22 + 9.6. The '+xml' Naming Convention for XML-Based Media Types . 23 + 9.6.1. The '+xml' Structured Syntax Suffix Registration . . 23 + 10. Security Considerations . . . . . . . . . . . . . . . . . . . 25 + 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 + 11.1. Normative References . . . . . . . . . . . . . . . . . . 27 + 11.2. Informative References . . . . . . . . . . . . . . . . . 29 + Appendix A. Why Use the '+xml' Suffix for XML-Based MIME Types? 32 + Appendix B. Core XML Specifications . . . . . . . . . . . . . . 32 + Appendix C. Operational Considerations . . . . . . . . . . . . . 32 + C.1. General Considerations . . . . . . . . . . . . . . . . . 33 + C.2. Considerations for Producers . . . . . . . . . . . . . . 33 + C.3. Considerations for Consumers . . . . . . . . . . . . . . 34 + Appendix D. Changes from RFC 3023 . . . . . . . . . . . . . . . 34 + Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 35 + + + + + + + + + + + + + + + + + + + + + + +Thompson & Lilley Standards Track [Page 3] + +RFC 7303 XML Media Types July 2014 + + +1. Introduction + + The World Wide Web Consortium has issued the Extensible Markup + Language (XML) 1.0 [XML] and Extensible Markup Language (XML) 1.1 + [XML1.1] specifications. To enable the exchange of XML network + entities, this specification standardizes three media types + (application/xml, application/xml-external-parsed-entity, and + application/xml-dtd), two aliases (text/xml and text/xml-external- + parsed-entity), and a naming convention for identifying XML-based + MIME media types (using '+xml'). + + XML has been used as a foundation for other media types, including + types in every branch of the IETF media types tree. To facilitate + the processing of such types, and in line with the recognition in + [RFC6838] of structured syntax name suffixes, a suffix of '+xml' is + registered in Section 9.6. This will allow generic XML-based tools + -- browsers, editors, search engines, and other processors -- to work + with all XML-based media types. + + This specification replaces [RFC3023]. Major differences are in the + areas of alignment of text/xml and text/xml-external-parsed-entity + with application/xml and application/xml-external-parsed-entity + respectively, the addition of XPointer and XML Base as fragment + identifiers and base URIs, respectively, integration of the XPointer + Registry and updating of many references. + +2. Notational Conventions + +2.1. Requirements Language + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and + "OPTIONAL" in this specification are to be interpreted as described + in [RFC2119]. + +2.2. Characters, Encodings, Charsets + + Both XML (in an XML or Text declaration using the encoding pseudo- + attribute) and MIME (in a Content-Type header field using the charset + parameter) use a common set of labels [IANA-CHARSETS] to identify the + MIME charset (mapping from byte stream to character sequence + [RFC2978]). + + In this specification, we will use the phrases "charset parameter" + and "encoding declaration" to refer to whatever MIME charset is + specified by a MIME charset parameter or XML encoding declaration, + + + + + +Thompson & Lilley Standards Track [Page 4] + +RFC 7303 XML Media Types July 2014 + + + respectively. We reserve the phrase "character encoding" (or, when + the context makes the intention clear, simply "encoding") for the + MIME charset actually used in a particular XML MIME entity. + + [UNICODE] defines three "encoding forms", namely UTF-8, UTF-16, and + UTF-32. As UTF-8 can only be serialized in one way, the only + possible label for UTF-8-encoded documents when serialised into MIME + entities is "utf-8". UTF-16 XML documents, however, can be + serialised into MIME entities in one of two ways: either big-endian, + labelled (optionally) "utf-16" or "utf-16be", or little-endian, + labelled (optionally) "utf-16" or "utf-16le". See Section 3.3 below + for how a Byte Order Mark (BOM) is required when the "utf-16" + serialization is used. + + UTF-32 has four potential serializations, of which only two (UTF-32BE + and UTF-32LE) are given names in [UNICODE]. Support for the various + serializations varies widely, and security concerns about their use + have been raised (for example, see [Sivonen]). The use of UTF-32 is + NOT RECOMMENDED for XML MIME entities. + +2.3. MIME Entities, XML Entities + + As sometimes happens between two communities, both MIME and XML have + defined the term entity, with different meanings. Section 2.4 of + [RFC2045] says: + + The term "entity", refers specifically to the MIME-defined header + fields and contents of either a message or one of the parts in the + body of a multipart entity. + + Section 4 of [XML] says: + + An XML document may consist of one or many storage units. These + are called entities; they all have content and are all (except for + the document entity and the external DTD subset) identified by + entity name. + + In this specification, "XML MIME entity" is defined as the latter (an + XML entity) encapsulated in the former (a MIME entity). + + Furthermore, XML provides for the naming and referencing of entities + for purposes of inclusion and/or substitution. In this + specification, "XML-entity declaration/reference/..." is used to + avoid confusion when referring to such cases. + + + + + + + +Thompson & Lilley Standards Track [Page 5] + +RFC 7303 XML Media Types July 2014 + + +3. Encoding Considerations + + The registrations below all address issues around character encoding + in the same way, by referencing this section. + + As many as three distinct sources of information about character + encoding may be present for an XML MIME entity: a charset parameter, + a BOM (see Section 3.3 below), and an XML encoding declaration (see + Section 4.3.3 of [XML]). Ensuring consistency among these sources + requires coordination between entity authors and MIME agents (that + is, processes that package, transfer, deliver, and/or receive MIME + entities). + + The use of UTF-8, without a BOM, is RECOMMENDED for all XML MIME + entities. + + Some MIME agents will be what we will call "XML-aware", that is, + capable of processing XML MIME entities as XML and detecting the XML + encoding declaration (or its absence). All three sources of + information about encoding are available to them, and they can be + expected to be aware of this specification. + + Other MIME agents will not be XML-aware; thus, they cannot know + anything about the XML encoding declaration. Not only do they lack + one of the three sources of information about encoding, they are also + less likely to be aware of or responsive to this specification. + + Some MIME agents, such as proxies and transcoders, both consume and + produce MIME entities. + + This mixture of two kinds of agents handling XML MIME entities + increases the complexity of the coordination task. The + recommendations given below are intended to maximise interoperability + in the face of this: on the one hand, by mandating consistent + production and encouraging maximally robust forms of production and, + on the other, by specifying recovery strategies to maximize the + interoperability of consumers when the production rules are broken. + +3.1. XML MIME Producers + + XML-aware MIME producers SHOULD supply a charset parameter and/or an + appropriate BOM with non-UTF-8-encoded XML MIME entities that lack an + encoding declaration. Such producers SHOULD remove or correct an + encoding declaration that is known to be incorrect (for example, as a + result of transcoding). + + + + + + +Thompson & Lilley Standards Track [Page 6] + +RFC 7303 XML Media Types July 2014 + + + XML-aware MIME producers MUST supply an XML text declaration at the + beginning of non-UNICODE XML external parsed entities that would + otherwise begin with the hexadecimal octet sequences 0xFE 0xFF, 0xFF + 0xFE or 0xEF 0xBB 0xBF, in order to avoid the mistaken detection of a + BOM. + + XML-unaware MIME producers MUST NOT supply a charset parameter with + an XML MIME entity unless the entity's character encoding is reliably + known. Note that this is particularly relevant for central + configuration of web servers, where configuring a default for the + charset parameter will almost certainly violate this requirement. + + XML MIME producers are RECOMMENDED to provide means for users to + control what value, if any, is given to charset parameters for XML + MIME entities, for example, by giving users control of the + configuration of Web server filename-to-Content-Type-header mappings + on a file-by-file or suffix basis. + +3.2. XML MIME Consumers + + For XML MIME consumers, the question of priority arises in cases when + the available character encoding information is not consistent. + Again, we must distinguish between XML-aware and XML-unaware agents. + + When a charset parameter is specified for an XML MIME entity, the + normative component of the [XML] specification leaves the question + open as to how to determine the encoding with which to attempt to + process the entity. This is true independently of whether or not the + entity contains in-band encoding information, that is, either a BOM + (Section 3.3) or an XML encoding declaration, both, or neither. In + particular, in the case where there is in-band information and it + conflicts with the charset parameter, the [XML] specification does + not specify which is authoritative. In its (non-normative) + Appendix F, it defers to this specification: + + [T]he preferred method of handling conflict should be specified as + part of the higher-level protocol used to deliver XML. In + particular, please refer to [IETF RFC 3023] or its successor... + + Accordingly, to conform with deployed processors and content and to + avoid conflicting with this or other normative specifications, this + specification sets the priority as follows: + + A BOM (Section 3.3) is authoritative if it is present in an XML + MIME entity; + + In the absence of a BOM (Section 3.3), the charset parameter is + authoritative if it is present. + + + +Thompson & Lilley Standards Track [Page 7] + +RFC 7303 XML Media Types July 2014 + + + Whenever the above determines a source of encoding information as + authoritative, consumers SHOULD process XML MIME entities based on + that information. + + When MIME producers conform to the requirements stated above + (Section 3.1, Section 3) inconsistencies will not arise -- the above + statement of priorities only has practical impact in the case of non- + conforming XML MIME entities. In the face of inconsistencies, no + uniform strategy can deliver the 'right' answer every time: the + purpose of specifying one here is to encourage convergence over time, + first on the part of consumers, then on the part of producers. + + For XML-aware consumers, note that Section 4.3.3 of [XML] does _not_ + make it an error for the charset parameter and the XML encoding + declaration (or the UTF-8 default in the absence of encoding + declaration and BOM) to be inconsistent, although such consumers + might choose to issue a warning in this case. + + If an XML MIME entity is received where the charset parameter is + omitted, no information is being provided about the character + encoding by the MIME Content-Type header. XML-aware consumers MUST + follow the requirements in section 4.3.3 of [XML] that directly + address this case. XML-unaware MIME consumers SHOULD NOT assume a + default encoding in this case. + +3.3. The BOM and Encoding Conversions + + Section 4.3.3 of [XML] specifies that UTF-16 XML MIME entities not + labelled as "utf-16le" or "utf-16be" MUST begin with a BOM, U+FEFF, + which appears as the hexadecimal octet sequence 0xFE 0xFF (big- + endian) or 0xFF 0xFE (little-endian). [XML] further states that the + BOM is an encoding signature and is not part of either the markup or + the character data of the XML document. + + Due to the presence of the BOM, applications that convert XML from + UTF-16 to an encoding other than UTF-8 MUST strip the BOM before + conversion. Similarly, when converting from another encoding into + UTF-16, either without a charset parameter or labelled "utf-16", the + BOM MUST be added unless the original encoding was UTF-8 and a BOM + was already present, in which case it MUST be transcoded into the + appropriate UTF-16 BOM. + + Section 4.3.3 of [XML] also allows for UTF-8 XML MIME entities to + begin with a BOM, which appears as the hexadecimal octet sequence + 0xEF 0xBB 0xBF. This is likewise defined to be an encoding + signature, and not part of either the markup or the character data of + the XML document. + + + + +Thompson & Lilley Standards Track [Page 8] + +RFC 7303 XML Media Types July 2014 + + + Applications that convert XML from UTF-8 to an encoding other than + UTF-16 MUST strip the BOM, if present, before conversion. + Applications that convert XML into UTF-8 MAY add a BOM. + + In addition to the MIME charset "utf-16", [RFC2781] introduces + "utf-16le" (little-endian) and "utf-16be" (big-endian). When an XML + MIME entity is encoded in "utf-16le" or "utf-16be", it MUST NOT begin + with the BOM but SHOULD contain an in-band XML encoding declaration. + Conversion from UTF-8 or UTF-16 (unlabelled, or labelled with + "utf-16") to "utf-16be" or "utf-16le" MUST strip a BOM if present. + Conversion from UTF-16 labelled "utf-16le" or "utf-16be" to UTF-16 + without a label or labelled "utf-16" MUST add the appropriate BOM. + Conversion from UTF-16 labelled "utf-16le" or "utf-16be" to UTF-8 MAY + add a UTF-8 BOM, but this is NOT RECOMMENDED. + + Appendix F of [XML] also implies that a UTF-32 BOM may be used in + conjunction with UTF-32-encoded documents. As noted above, this + specification recommends against the use of UTF-32. If it is used, + the same considerations as UTF-16 apply with respect to its being a + signature (not part of the document), transcoding into or out of it, + and transcoding into or out of the MIME charsets "utf-32le" and "utf- + 32be". Consumers that do not support UTF-32 SHOULD nonetheless + recognise UTF-32 signatures in order to give helpful error messages + (instead of treating them as invalid UTF-16). + +4. XML Media Types + +4.1. XML MIME Entities + + Within the XML specification, XML MIME entities can be classified + into four types. In the XML terminology, they are called "document + entities", "external DTD subsets", "external parsed entities", and + "external parameter entities". Appropriate usage for the types + registered below is as follows: + + document entities: The media types application/xml or text/xml, or a + more specific media type (see Section 9.6), SHOULD be used. + + external DTD subsets: The media type application/xml-dtd SHOULD be + used. The media types application/xml and text/xml MUST NOT be + used. + + external parsed entities: The media types application/xml-external- + parsed-entity or text/xml-external-parsed-entity SHOULD be used. + The media types application/xml and text/xml MUST NOT be used + unless the parsed entities are also well-formed "document + entities". + + + + +Thompson & Lilley Standards Track [Page 9] + +RFC 7303 XML Media Types July 2014 + + + external parameter entities: The media type application/xml-dtd + SHOULD be used. The media types application/xml and text/xml MUST + NOT be used. + + Note that [RFC3023] (which this specification obsoletes) recommended + the use of text/xml and text/xml-external-parsed-entity for document + entities and external parsed entities, respectively, but described + handling of character encoding that differed from common + implementation practice. These media types are still commonly used, + and this specification aligns the handling of character encoding with + industry practice. + + Note that [RFC2376] (which is obsolete) allowed application/xml and + text/xml to be used for any of the four types, although in practice + it is likely to have been rare. + + Neither external DTD subsets nor external parameter entities parse as + XML documents, and while some XML document entities may be used as + external parsed entities and vice versa, there are many cases where + the two are not interchangeable. XML also has unparsed entities, + internal parsed entities, and internal parameter entities, but they + are not XML MIME entities. + + Compared to [RFC2376] or [RFC3023], this specification alters the + handling of character encoding of text/xml and text/xml-external- + parsed-entity, treating them no differently from the respective + application/ types. However, application/xml and application/xml- + external-parsed-entity are still RECOMMENDED, to avoid possible + confusion based on the earlier distinction. The former confusion + around the question of default character sets for the two text/ types + no longer arises because + + [RFC7231] changes [RFC2616] by removing the ISO-8859-1 default and + not defining any default at all; + + [RFC6657] updates [RFC2046] to remove the US-ASCII [ASCII] + default. + + See Section 3 for the now-unified approach to the charset parameter + that results. + + XML provides a general framework for defining sequences of structured + data. It is often appropriate to define new media types that use XML + but define a specific application of XML, due to domain-specific + display, editing, security considerations, or runtime information. + Furthermore, such media types may allow only UTF-8 and/or UTF-16 and + prohibit other character sets. This specification does not prohibit + such media types; in fact, they are expected to proliferate. + + + +Thompson & Lilley Standards Track [Page 10] + +RFC 7303 XML Media Types July 2014 + + + However, developers of such media types are RECOMMENDED to use this + specification as a basis for their registration. See Section 4.2 for + more detailed recommendations on using the '+xml' suffix for + registration of such media types. + + An XML document labeled as application/xml or text/xml, or with a + '+xml' media type, might contain namespace declarations, stylesheet- + linking processing instructions (PIs), schema information, or other + declarations that might be used to suggest how the document is to be + processed. For example, a document might have the XHTML namespace + and a reference to a Cascading Style Sheets (CSS) stylesheet. Such a + document might be handled by applications that would use this + information to dispatch the document for appropriate processing. + Appendix B lists the core XML specifications that, taken together + with [XML] itself, show how to determine an XML document's language- + level semantics and suggest how information about its application- + level semantics may be locatable. + +4.2. Using '+xml' when Registering XML-Based Media Types + + In Section 9.6, this specification updates the registration in + [RFC6839] for XML-based MIME types (the '+xml' types). + + When a new media type is introduced for an XML-based format, the name + of the media type SHOULD end with '+xml' unless generic XML + processing is in some way inappropriate for documents of the new + type. This convention will allow applications that can process XML + generically to detect that the MIME entity is supposed to be an XML + document, verify this assumption by invoking some XML processor, and + then process the XML document accordingly. Applications may check + for types that represent XML MIME entities by comparing the last four + characters of the subtype to the string '+xml'. (However, note that + four of the five media types defined in this specification -- text/ + xml, application/xml, text/xml-external-parsed-entity, and + application/xml-external-parsed-entity -- also represent XML MIME + entities while not ending with '+xml'.) + + NOTE: Section 5.3.2 of [RFC7231] does not support any form of + Accept header that will match only '+xml' types. In particular, + Accept headers of the form "Accept: */*+xml" are not allowed, and + will not work for this purpose. + + Media types following the naming convention '+xml' SHOULD define the + charset parameter for consistency, since XML-generic processing by + definition treats all XML MIME entities uniformly as regards + character encoding information. However, there are some cases that + the charset parameter need not be defined. For example: + + + + +Thompson & Lilley Standards Track [Page 11] + +RFC 7303 XML Media Types July 2014 + + + When an XML-based media type is restricted to UTF-8, it is not + necessary to define the charset parameter. UTF-8 is the default + for XML. + + When an XML-based media type is restricted to UTF-8 and UTF-16, it + might not be unreasonable to omit the charset parameter. Neither + UTF-8 nor UTF-16 require XML encoding declarations. + + XML generic processing is not always appropriate for XML-based media + types. For example, authors of some such media types may wish that + the types remain entirely opaque except to applications that are + specifically designed to deal with that media type. By NOT following + the naming convention '+xml', such media types can avoid XML-generic + processing. Since generic processing will be useful in many cases, + however -- including in some situations that are difficult to predict + ahead of time -- the '+xml' convention is to be preferred unless + there is some particularly compelling reason not to use it. + + The registration process for specific '+xml' media types is described + in [RFC6838]. New XML-based media type registrations in the IETF + must follow these guidelines. When other organisations register XML- + based media types via the "Specification Required" IANA registration + policy [RFC5226], the relevant Media Reviewer should ensure that they + use the '+xml' convention, in order to ensure maximum + interoperability of their XML-based documents. Only media subtypes + that represent XML MIME entities are allowed to register with a + '+xml' suffix. + + In addition to the changes described above, the change controller has + been changed to be the World Wide Web Consortium (W3C). + +4.3. Registration Guidelines for XML-Based Media Types Not Using '+xml' + + Registrations for new XML-based media types that do _not_ use the + '+xml' suffix SHOULD, in specifying the charset parameter and + encoding considerations, define them as: "Same as [charset parameter + / encoding considerations] of application/xml as specified in RFC + 7303". + + Defining the charset parameter is RECOMMENDED, since this information + can be used by XML processors to determine authoritatively the + character encoding of the XML MIME entity in the absence of a BOM. + If there are some reasons not to follow this advice, they SHOULD be + included as part of the registration. As shown above, two such + reasons are "UTF-8 only" or "UTF-8 or UTF-16 only". + + + + + + +Thompson & Lilley Standards Track [Page 12] + +RFC 7303 XML Media Types July 2014 + + + These registrations SHOULD specify that the XML-based media type + being registered has all of the security considerations described in + this specification plus any additional considerations specific to + that media type. + + These registrations SHOULD also make reference to this specification + in specifying magic numbers, base URIs, and use of the BOM. + + These registrations MAY reference the application/xml registration in + this document in specifying interoperability and fragment identifier + considerations, if these considerations are not overridden by issues + specific to that media type. + +5. Fragment Identifiers + + Uniform Resource Identifiers (URIs) can contain fragment identifiers + (see Section 3.5 of [RFC3986]). Specifying the syntax and semantics + of fragment identifiers is devolved by [RFC3986] to the appropriate + media type registration. + + The syntax and semantics of fragment identifiers for the XML media + types defined in this specification are based on the + [XPointerFramework] W3C Recommendation. It allows simple names and + more complex constructions based on named schemes. When the syntax + of a fragment identifier part of any URI or Internationalized + Resource Identifier (IRI) ([RFC3987]) with a retrieved media type + governed by this specification conforms to the syntax specified in + [XPointerFramework], conforming applications MUST interpret such + fragment identifiers as designating whatever is specified by the + [XPointerFramework] together with any other specifications governing + the XPointer schemes used in those identifiers that the applications + support. Conforming applications MUST support the 'element' scheme + as defined in [XPointerElement], but need not support other schemes. + + If an XPointer error is reported in the attempt to process the part, + this specification does not define an interpretation for the part. + + A registry of XPointer schemes [XPtrReg] is maintained at the W3C. + Generic processors of XML MIME entities SHOULD NOT implement + unregistered XPointer schemes ([XPtrRegPolicy] describes requirements + and procedures for registering schemes). + + See Section 4.2 for additional requirements that apply when an XML- + based media type follows the naming convention '+xml'. + + If [XPointerFramework] and [XPointerElement] are inappropriate for + some XML-based media type, it SHOULD NOT follow the naming convention + '+xml'. + + + +Thompson & Lilley Standards Track [Page 13] + +RFC 7303 XML Media Types July 2014 + + + When a URI has a fragment identifier, it is encoded by a limited + subset of the repertoire of US-ASCII characters, see + [XPointerFramework] for details. + +6. The Base URI + + An XML MIME entity of type application/xml, text/xml, application/ + xml-external-parsed-entity, or text/xml-external-parsed-entity MAY + use the xml:base attribute, as described in [XMLBase], to embed a + base URI in that entity for use in resolving relative URI references + (see Section 5.1 of [RFC3986]). + + Note that the base URI itself might be embedded in a different MIME + entity, since the default value for the xml:base attribute can be + specified in an external DTD subset or external parameter entity. + Since conforming XML processors need not always read and process + external entities, the effect of such an external default is + uncertain; therefore, its use is NOT RECOMMENDED. + +7. XML Versions + + application/xml, application/xml-external-parsed-entity, application/ + xml-dtd, text/xml, and text/xml-external-parsed-entity are to be used + with [XML]. In all examples herein where version="1.0" is shown, it + is understood that version="1.1" might also appear, providing the + content does indeed conform to [XML1.1]. + + The normative requirement of this specification upon XML documents + and processors is to follow the requirements of [XML], Section 4.3.3. + + Except for minor clarifications, that section is substantially + identical from the first edition to the current (5th) edition of XML + 1.0, and for XML 1.1 first or second edition [XML1.1]. Therefore, + references herein to [XML] may be interpreted as referencing any + existing version or edition of XML, or any subsequent edition or + version that makes no incompatible changes to that section. + + Specifications and recommendations based on or referring to this RFC + SHOULD indicate any limitations on the particular versions or + editions of XML to be used. + +8. Examples + + This section is non-normative. In particular, note that all + [RFC2119] language herein reproduces or summarizes the consequences + of normative statements already made above, and has no independent + normative force, and accordingly does not appear in uppercase. + + + + +Thompson & Lilley Standards Track [Page 14] + +RFC 7303 XML Media Types July 2014 + + + The examples below give the MIME Content-Type header, including the + charset parameter, if present and the XML declaration or Text + declaration (which includes the encoding declaration) inside the XML + MIME entity. For UTF-16 examples, the Byte Order Mark character + appropriately UTF-16 encoded is denoted as "{BOM}", and the XML or + Text declaration is assumed to come at the beginning of the XML MIME + entity, immediately following the encoded BOM. Note that other MIME + headers may be present, and the XML MIME entity will normally contain + other data in addition to the XML declaration; the examples focus on + the Content-Type header and the encoding declaration for clarity. + + Although they show a content type of 'application/xml', all the + examples below apply to all five media types declared below in + Section 9, as well as to any media types declared using the '+xml' + convention (with the exception of the examples involving the charset + parameter for any such media types that do not enable its use). See + the XML MIME entities table (Section 4.1, Paragraph 1) for discussion + of which types are appropriate for which varieties of XML MIME + entity. + +8.1. UTF-8 Charset + + Content-Type: application/xml; charset=utf-8 + + + + or + + + + UTF-8 is the recommended encoding for use with all the media types + defined in this specification. Since the charset parameter is + provided and there is no overriding BOM, conformant MIME and XML + processors must treat the enclosed entity as UTF-8 encoded. + + If sent using a 7-bit transport (e.g., SMTP [RFC5321]), in general, a + UTF-8 XML MIME entity must use a content-transfer-encoding of either + quoted-printable or base64. For an 8-bit clean transport (e.g., + 8BITMIME ESMTP or NNTP), or a binary clean transport (e.g., BINARY + ESMTP or HTTP), no content-transfer-encoding is necessary (or even + possible, in the case of HTTP). + + + + + + + + + + +Thompson & Lilley Standards Track [Page 15] + +RFC 7303 XML Media Types July 2014 + + +8.2. UTF-16 Charset + + Content-Type: application/xml; charset=utf-16 + + {BOM} + + or + + {BOM} + + For the three application/media types defined above, if sent using a + 7-bit transport (e.g., SMTP) or an 8-bit clean transport (e.g., + 8BITMIME ESMTP or NNTP), the XML MIME entity must be encoded in + quoted-printable or base64; for a binary clean transport (e.g., + BINARY ESMTP or HTTP), no content-transfer-encoding is necessary (or + even possible, in the case of HTTP). + + As described in [RFC2781], the UTF-16 family must not be used with + media types under the top-level type "text" except over HTTP or HTTPS + (see Section A.2 of HTTP [RFC7231] for details). Hence, one of the + two text/media types defined above can be used with this example only + when the XML MIME entity is transmitted via HTTP or HTTPS, which use + a MIME-like mechanism and are binary-clean protocols and hence do not + perform CR and LF transformations and allow NUL octets. Since HTTP + is binary clean, no content-transfer-encoding is necessary (or even + possible). + +8.3. Omitted Charset and 8-Bit MIME Entity + + Content-Type: application/xml + + + + Since the charset parameter is not provided in the Content-Type + header and there is no overriding BOM, conformant XML processors must + treat the "iso-8859-1" encoding as authoritative. Conformant XML- + unaware MIME processors should make no assumptions about the + character encoding of the XML MIME entity. + +8.4. Omitted Charset and 16-Bit MIME Entity + + Content-Type: application/xml + + {BOM} + + or + + {BOM} + + + +Thompson & Lilley Standards Track [Page 16] + +RFC 7303 XML Media Types July 2014 + + + This example shows a 16-bit MIME entity with no charset parameter. + However, since there is a BOM, conformant processors must treat the + entity as UTF-16 encoded. + + Omitting the charset parameter is not recommended in conjunction with + media types under the top-level type "application" when used with + transports other than HTTP or HTTPS. Media types under the top-level + type "text" should not be used for 16-bit MIME with transports other + than HTTP or HTTPS (see discussion above in + Section 8.2, Paragraph 7). + +8.5. Omitted Charset, No Internal Encoding Declaration + + Content-Type: application/xml + + + + In this example, the charset parameter has been omitted, there is no + internal encoding declaration, and there is no BOM. Since there is + no BOM or charset parameter, the XML processor follows the + requirements in Section 4.3.3, and optionally applies the mechanism + described in Appendix F (which is non-normative) of [XML] to + determine an encoding of UTF-8. Although the XML MIME entity does + not contain an encoding declaration, provided the encoding actually + _is_ UTF-8, this is a conforming XML MIME entity. + + A conformant XML-unaware MIME processor should make no assumptions + about the character encoding of the XML MIME entity. + + See Section 8.1 for transport-related issues for UTF-8 XML MIME + entities. + +8.6. UTF-16BE Charset + + Content-Type: application/xml; charset=utf-16be + + + + Observe that, as required for this encoding, there is no BOM. Since + the charset parameter is provided and there is no overriding BOM, + conformant MIME and XML processors must treat the enclosed entity as + UTF-16BE encoded. + + See also the additional considerations in the UTF-16 example in + Section 8.2. + + + + + + +Thompson & Lilley Standards Track [Page 17] + +RFC 7303 XML Media Types July 2014 + + +8.7. Non-UTF Charset + + Content-Type: application/xml; charset=iso-2022-kr + + + + This example shows the use of a non-UTF character encoding (in this + case Hangul, but this example is intended to cover all non-UTF-family + character encodings). Since the charset parameter is provided and + there is no overriding BOM, conformant processors must treat the + enclosed entity as encoded per RFC 1557. + + Since ISO-2022-KR [RFC1557] has been defined to use only 7 bits of + data, no content-transfer-encoding is necessary with any transport: + for character sets needing 8 or more bits, considerations such as + those discussed above (Sections 8.1 and 8.2) would apply. + +8.8. INCONSISTENT EXAMPLE: Conflicting Charset and Internal Encoding + Declaration + + Content-Type: application/xml; charset=iso-8859-1 + + + + Although the charset parameter is provided in the Content-Type header + and there is no BOM and the charset parameter differs from the XML + encoding declaration, conformant MIME and XML processors will + interoperate. Since the charset parameter is authoritative in the + absence of a BOM, conformant processors will treat the enclosed + entity as iso-8859-1 encoded. That is, the "UTF-8" encoding + declaration will be ignored. + + Conformant processors generating XML MIME entities must not label + conflicting character encoding information between the MIME Content- + Type and the XML declaration unless they have definitive information + about the actual encoding, for example, as a result of systematic + transcoding. In particular, the addition by servers of an explicit, + site-wide charset parameter default has frequently lead to + interoperability problems for XML documents. + +8.9. INCONSISTENT EXAMPLE: Conflicting Charset and BOM + + Content-Type: application/xml; charset=iso-8859-1 + + {BOM} + + + + + + +Thompson & Lilley Standards Track [Page 18] + +RFC 7303 XML Media Types July 2014 + + + Although the charset parameter is provided in the Content-Type + header, there is a BOM, so MIME and XML processors may not + interoperate. Since the BOM parameter is authoritative for + conformant XML processors, they will treat the enclosed entity as + UTF-16 encoded. That is, the "iso-8859-1" charset parameter will be + ignored. XML-unaware MIME processors on the other hand may be + unaware of the BOM and so treat the entity as encoded in iso-8859-1. + + Conformant processors generating XML MIME entities must not label + conflicting character encoding information between the MIME Content- + Type and an entity-initial BOM. + +9. IANA Considerations + +9.1. application/xml Registration + + Type name: application + + Subtype name: xml + + Required parameters: none + + Optional parameters: charset + + See Section 3. + + Encoding considerations: Depending on the character encoding used, + XML MIME entities can consist of 7bit, 8bit, or binary data + [RFC6838]. For 7-bit transports, 7bit data, for example, US- + ASCII-encoded data, does not require content-transfer-encoding, + but 8bit or binary data, for example, UTF-8 or UTF-16 data, MUST + be content-transfer-encoded in quoted-printable or base64. For + 8-bit clean transport (e.g., 8BITMIME ESMTP [RFC6152] or NNTP + [RFC3977]), 7bit or 8bit data, for example, US-ASCII or UTF-8 + data, does not require content-transfer-encoding, but binary data, + for example, data with a UTF-16 encoding, MUST be content- + transfer-encoded in base64. For binary clean transports (e.g., + BINARY ESMTP [RFC3030] or HTTP [RFC7230]), no content-transfer- + encoding is necessary (or even possible, in the case of HTTP) for + 7bit, 8bit, or binary data. + + Security considerations: See Section 10. + + Interoperability considerations: XML has proven to be interoperable + across both generic and task-specific applications and for import + and export from multiple XML authoring and editing tools. + Validating processors provide maximum interoperability, because + they have to handle all aspects of XML. Although a non-validating + + + +Thompson & Lilley Standards Track [Page 19] + +RFC 7303 XML Media Types July 2014 + + + processor may be more efficient, it might not handle all aspects. + For further information, see Section 2.9 "Standalone Document + Declaration" and Section 5 "Conformance" of [XML] . + + In practice, character set issues have proved to be the biggest + source of interoperability problems. The use of UTF-8, and + careful attention to the guidelines set out in Section 3, are the + best ways to avoid such problems. + + Published specification: Extensible Markup Language (XML) 1.0 (Fifth + Edition) [XML] or subsequent editions or versions thereof. + + Applications that use this media type: XML is device, platform, and + vendor neutral and is supported by generic and task-specific + applications and a wide range of generic XML tools (editors, + parsers, Web agents, ...). + + Additional information: + + Magic number(s): None. + + Although no byte sequences can be counted on to always be + present, XML MIME entities in ASCII-compatible character sets + (including UTF-8) often begin with hexadecimal 3C 3F 78 6D 6C + (". + + [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message + Bodies", RFC 2045, November 1996. + + [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types", RFC 2046, + November 1996. + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119, March 1997. + + [RFC2781] Hoffman, P. and F. Yergeau, "UTF-16, an encoding of ISO + 10646", RFC 2781, February 2000. + + [RFC2978] Freed, N. and J. Postel, "IANA Charset Registration + Procedures", BCP 19, RFC 2978, October 2000. + + [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform + Resource Identifier (URI): Generic Syntax", STD 66, RFC + 3986, January 2005. + + [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource + Identifiers (IRIs)", RFC 3987, January 2005. + + [RFC6657] Melnikov, A. and J. Reschke, "Update to MIME regarding + "charset" Parameter Handling in Textual Media Types", RFC + 6657, July 2012. + + [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type + Specifications and Registration Procedures", BCP 13, RFC + 6838, January 2013. + + [RFC6839] Hansen, T. and A. Melnikov, "Additional Media Type + Structured Syntax Suffixes", RFC 6839, January 2013. + + [RFC7230] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol + (HTTP/1.1): Message Syntax and Routing", RFC 7230, June + 2014. + + + + + +Thompson & Lilley Standards Track [Page 27] + +RFC 7303 XML Media Types July 2014 + + + [RFC7231] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol + (HTTP/1.1): Semantics and Content", RFC 7231, June 2014. + + [UNICODE] The Unicode Consortium, "The Unicode Standard, Version + 7.0.0", (Mountain View, CA: The Unicode Consortium, 2014 + ISBN 978-1-936213-09-2), + . + + [XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and + F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth + Edition)", W3C Recommendation REC-xml, November 2008, + . + + Latest version available at . + + [XML1.1] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., + Yergeau, F., and J. Cowan, "Extensible Markup Language + (XML) 1.1 (Second Edition)", W3C Recommendation REC-xml, + September 2006, + . + + Latest version available at . + + [XMLBase] Marsh, J. and R. Tobin, "XML Base (Second Edition)", W3C + Recommendation REC-xmlbase-20090128, January 2009, + . + + Latest version available at + . + + [XPointerElement] + Grosso, P., Maler, E., Marsh, J., and N. Walsh, "XPointer + element() Scheme", W3C Recommendation REC-XPointer- + Element, March 2003, + . + + Latest version available at + . + + [XPointerFramework] + Grosso, P., Maler, E., Marsh, J., and N. Walsh, "XPointer + Framework", W3C Recommendation REC-XPointer-Framework, + March 2003, + . + + Latest version available at + . + + + + +Thompson & Lilley Standards Track [Page 28] + +RFC 7303 XML Media Types July 2014 + + + [XPtrReg] Hazael-Massieux, D., "XPointer Registry", 2005, + . + + [XPtrRegPolicy] + Hazael-Massieux, D., "XPointer Scheme Name Registry + Policy", 2005, + . + +11.2. Informative References + + [ASCII] American National Standards Institute, "Coded Character + Set -- 7-bit American Standard Code for Information + Interchange", ANSI X3.4, 1986. + + [AWWW] Jacobs, I. and N. Walsh, "Architecture of the World Wide + Web, Volume One", W3C Recommendation REC-webarch-20041215, + December 2004, + . + + Latest version available at + . + + [FYN] Mendelsohn, N., "The Self-Describing Web", W3C TAG Finding + selfDescribingDocuments-2009-02-07, February 2009, + . + + Latest version available at + + + [Infoset] Cowan, J. and R. Tobin, "XML Information Set (Second + Edition)", W3C Recommendation REC-xml-infoset-20040204, + Febuary 2004, + . + + Latest version available at + . + + [MediaFrags] + Troncy, R., Mannens, E., Pfeiffer, S., and D. Van Deursen, + "Media Fragments URI 1.0 (basic)", W3C Recommendation + media-frags, September 2012, + . + + Latest version available at + . + + + + +Thompson & Lilley Standards Track [Page 29] + +RFC 7303 XML Media Types July 2014 + + + [RFC1557] Choi, U., Chon, K., and H. Park, "Korean Character + Encoding for Internet Messages", RFC 1557, December 1993. + + [RFC2376] Whitehead, E. and M. Murata, "XML Media Types", RFC 2376, + July 1998. + + [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., + Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext + Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. + + [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media + Types", RFC 3023, January 2001. + + [RFC3030] Vaudreuil, G., "SMTP Service Extensions for Transmission + of Large and Binary MIME Messages", RFC 3030, December + 2000. + + [RFC3977] Feather, C., "Network News Transfer Protocol (NNTP)", RFC + 3977, October 2006. + + [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an + IANA Considerations Section in RFCs", BCP 26, RFC 5226, + May 2008. + + [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, + October 2008. + + [RFC6152] Klensin, J., Freed, N., Rose, M., and D. Crocker, "SMTP + Service Extension for 8-bit MIME Transport", STD 71, RFC + 6152, March 2011. + + [Sivonen] Sivonen, H. and others, "Mozilla bug: Remove support for + UTF-32 per HTML5 spec", October 2011, + . + + [TAGMIME] Bray, T., Ed., "Internet Media Type registration, + consistency of use", April 2004, + . + + [XHTML] Pemberton, S. and et al, "XHTML 1.0: The Extensible + HyperText Markup Language", W3C Recommendation xhtml1, + December 1999, + . + + Latest version available at . + + + + + + +Thompson & Lilley Standards Track [Page 30] + +RFC 7303 XML Media Types July 2014 + + + [XMLModel] Grosso, P. and J. Kosek, "Associating Schemas with XML + documents 1.0 (Third Edition)", W3C Working Group Note + NOTE-xml-model-20121009, October 2012, + . + + Latest version available at + . + + [XMLNS10] Bray, T., Hollander, D., Layman, A., Tobin, R., and H. + Thompson, "Namespaces in XML 1.0 (Third Edition)", W3C + Recommendation REC-xml-names-20091208, December 2009, + . + + Latest version available at + . + + [XMLNS11] Bray, T., Hollander, D., Layman, A., and R. Tobin, + "Namespaces in XML 1.1 (Second Edition)", W3C + Recommendation REC-xml-names11-20060816, August 2006, + . + + Latest version available at + . + + [XMLSS] Clark, J., Pieters, S., and H. Thompson, "Associating + Style Sheets with XML documents 1.0 (Second Edition)", W3C + Recommendation REC-xml-stylesheet-20101028, October 2010, + . + + Latest version available at + . + + [XMLid] Marsh, J., Veillard, D., and N. Walsh, "xml:id Version + 1.0", W3C Recommendation REC-xml-id-20050909, September + 2005, . + + Latest version available at + . + + + + + + + + + + + + + +Thompson & Lilley Standards Track [Page 31] + +RFC 7303 XML Media Types July 2014 + + +Appendix A. Why Use the '+xml' Suffix for XML-Based MIME Types? + + [RFC3023] contains a detailed discussion of the (at the time) novel + use of a suffix, a practice that has since become widespread. Those + interested in a historical perspective on this topic are referred to + [RFC3023], Appendix A. + + The registration process for new '+xml' media types is described in + [RFC6838]. + +Appendix B. Core XML Specifications + + The following specifications each articulate key aspects of XML + document semantics: + + Namespaces in XML 1.0 [XMLNS10]/Namespaces in XML 1.1 [XMLNS11] + + XML Information Set [Infoset] + + xml:id [XMLid] + + XML Base [XMLBase] + + Associating Style Sheets with XML documents [XMLSS] + + Associating Schemas with XML documents [XMLModel] + + The W3C Technical Architecture group has produced two documents that + are also relevant: + + The Self-Describing Web [FYN] discusses the overall principles of + how document semantics are determined on the Web. + + Architecture of the World Wide Web, Volume One [AWWW], + Section 4.5.4, discusses the specific role of XML Namespace + documents in this process. + +Appendix C. Operational Considerations + + This section provides an informal summary of the major operational + considerations that arise when exchanging XML MIME entities over a + network. + + + + + + + + + +Thompson & Lilley Standards Track [Page 32] + +RFC 7303 XML Media Types July 2014 + + +C.1. General Considerations + + The existence of both XML-aware and XML-unaware agents handling XML + MIME entities can compromise introperability. Generic transcoding + proxies pose a particular risk in this regard. Detailed advice about + the handling of BOMs when transcoding can be found in Section 3.3. + + This specification requires XML consumers to treat BOMs as + authoritative: this is in principle a backwards-incompatibility. In + practice, serious interoperability issues already exist when BOMs are + used. Making BOMs authoritative, in conjunction with the deprecation + of the UTF-32 encoding form and the requirement to include an XML + encoding declaration in certain cases (Section 3.1), is intended to + improve in-practice interoperability as much as possible over time. + + This specification establishes Section 5 as the basis for + interpreting URIs for XML MIME entities that include fragment + identifiers, mandates support only for shorthand ("simple name") and + 'element'-scheme fragments and deprecates support for unregistered + XPointer schemes by XML MIME entity processors. Accordingly, URIs + will interoperate best if they use only simple names and 'element'- + scheme fragment identifiers, with registered schemes varying widely + in the degree of support to be found in generic tools. XPointer + scheme authors can only expect generic tool support if they register + their schemes. + +C.2. Considerations for Producers + + Interoperability for all XML MIME entities is maximized by the use of + UTF-8, without a BOM. When UTF-8 is _not_ used, a charset parameter + and/or a BOM improve interoperability, particularly when XML-unaware + consumers may be involved. + + In the very rare case where the substantive content of a non-UNICODE + XML external parsed entity begins with the hexadecimal octet + sequences 0xFE 0xFF, 0xFF 0xFE or 0xEF 0xBB 0xBF, including an XML + text declaration will forestall the mistaken detection of a BOM. + + The use of UTF-32 for XML MIME entities puts interoperability at very + high risk. + + Web-server configurations that supply default charset parameters risk + misrepresenting XML MIME entities. Allowing users to control the + value of charset parameters improves interoperability. + + + + + + + +Thompson & Lilley Standards Track [Page 33] + +RFC 7303 XML Media Types July 2014 + + + Supplying a mistaken charset parameter is worse than supplying none + at all. In particular, generic processors such as transcoders, when + processing based on a mistaken charset parameter, if they do not fail + altogether are likely to produce arbitrarily bogus results from which + the original is not recoverable. + +C.3. Considerations for Consumers + + Consumers of XML MIME entities can maximize interoperability by + + 1. Taking a BOM as authoritative if it is present in an XML MIME + entity; + + 2. In the absence of a BOM, taking a charset parameter as + authoritative if it is present. + + Assuming a default character encoding in the absence of a charset + parameter harms interoperability. + + Although support for UTF-32 is not required by [XML] itself, and this + specification deprecates its use, consumers that check for UTF-32 + BOMs can thereby avoid mistakenly processing UTF-32 entities as + (invalid) UTF-16 entities. + +Appendix D. Changes from RFC 3023 + + There are numerous and significant differences between this + specification and [RFC3023], which it obsoletes. This appendix + summarizes the major differences only. + + XPointer ([XPointerFramework] and [XPointerElement]) has been + added as fragment identifier syntax for all the XML media types, + and the XPointer Registry ([XPtrReg]) mentioned + + [XMLBase] has been added as a mechanism for specifying base URIs + + The language regarding character sets was updated to correspond to + the W3C TAG finding Internet Media Type registration, consistency + of use [TAGMIME] + + Priority is now given to a BOM if present + + Many references are updated, and the existence of XML 1.1 and + relevance of this specification to it acknowledged + + A number of justifications and contextualizations that were + appropriate when XML was new have been removed, including the + whole of the original Appendix A + + + +Thompson & Lilley Standards Track [Page 34] + +RFC 7303 XML Media Types July 2014 + + +Appendix E. Acknowledgements + + MURATA Makoto (FAMILY Given) and Alexey Melnikov made early and + important contributions to the effort to revise [RFC3023]. + + This specification reflects the input of numerous participants to the + ietf-xml-mime@imc.org, xml-mime@ietf.org, and apps-discuss@ietf.org + mailing lists, though any errors are the responsibility of the + authors. Special thanks to: + + Mark Baker, James Clark, Dan Connolly, Martin Duerst, Ned Freed, + Yaron Goland, Bjoern Hoehrmann, Rick Jelliffe, Murray S. Kucherawy, + Larry Masinter, David Megginson, S. Moonesamy, Keith Moore, Chris + Newman, Gavin Nicol, Julian Reschke, Marshall Rose, Jim Whitehead, + Erik Wilde, and participants of the XML activity and the TAG at the + W3C. + + Jim Whitehead and Simon St. Laurent were editors of [RFC2376] and + [RFC3023], respectively. + +Authors' Addresses + + Henry S. Thompson + University of Edinburgh + + EMail: ht@inf.ed.ac.uk + URI: http://www.ltg.ed.ac.uk/~ht/ + + + Chris Lilley + World Wide Web Consortium + 2004, Route des Lucioles - B.P. 93 06902 + Sophia Antipolis Cedex + France + + EMail: chris@w3.org + URI: http://www.w3.org/People/chris/ + + + + + + + + + + + + + + +Thompson & Lilley Standards Track [Page 35] + diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc7763-text-markdown.txt b/docs/research/non-pdf-dom-evidence/standards/rfc7763-text-markdown.txt new file mode 100644 index 000000000..43617aa79 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc7763-text-markdown.txt @@ -0,0 +1,843 @@ + + + + + + +Internet Engineering Task Force (IETF) S. Leonard +Request for Comments: 7763 Penango, Inc. +Category: Informational March 2016 +ISSN: 2070-1721 + + + The text/markdown Media Type + +Abstract + + This document registers the text/markdown media type for use with + Markdown, a family of plain-text formatting syntaxes that optionally + can be converted to formal markup languages such as HTML. + +Status of This Memo + + This document is not an Internet Standards Track specification; it is + published for informational purposes. + + This document is a product of the Internet Engineering Task Force + (IETF). It represents the consensus of the IETF community. It has + received public review and has been approved for publication by the + Internet Engineering Steering Group (IESG). Not all documents + approved by the IESG are a candidate for any level of Internet + Standard; see Section 2 of RFC 5741. + + Information about the current status of this document, any errata, + and how to provide feedback on it may be obtained at + http://www.rfc-editor.org/info/rfc7763. + +Copyright Notice + + Copyright (c) 2016 IETF Trust and the persons identified as the + document authors. All rights reserved. + + This document is subject to BCP 78 and the IETF Trust's Legal + Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info) in effect on the date of + publication of this document. Please review these documents + carefully, as they describe your rights and restrictions with respect + to this document. Code Components extracted from this document must + include Simplified BSD License text as described in Section 4.e of + the Trust Legal Provisions and are provided without warranty as + described in the Simplified BSD License. + + + + + + + +Leonard Informational [Page 1] + +RFC 7763 The text/markdown Media Type March 2016 + + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 + 1.1. This Is Markdown! Or: Markup and Its Discontents . . . . . 2 + 1.2. Markdown Is About Writing and Editing . . . . . . . . . . . 3 + 1.3. Definitions . . . . . . . . . . . . . . . . . . . . . . . . 5 + 2. Markdown Media Type Registration Application . . . . . . . . . 5 + 3. Fragment Identifiers . . . . . . . . . . . . . . . . . . . . . 8 + 3.1. Parameters . . . . . . . . . . . . . . . . . . . . . . . . 8 + 4. Content Disposition and preview-type . . . . . . . . . . . . . 9 + 5. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 + 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 + 6.1. Markdown Variants . . . . . . . . . . . . . . . . . . . . . 10 + 7. Security Considerations . . . . . . . . . . . . . . . . . . . . 13 + 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13 + 8.1. Normative References . . . . . . . . . . . . . . . . . . . 13 + 8.2. Informative References . . . . . . . . . . . . . . . . . . 14 + Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 15 + +1. Introduction + +1.1. This Is Markdown! Or: Markup and Its Discontents + + In computer systems, textual data is stored and processed using a + continuum of techniques. On the one end is plain text: computer- + encoded text that consists only of a sequence of code points from a + given standard, with no other formatting or structural information + [UNICODE]. (On the other end is binary data, which computer systems + store and process with bit-for-bit accuracy.) Many of these standards + include control characters that are used as in-band signaling to + cause effects other than the addition of a symbol (or grapheme) to + the text. + + Markup offers an alternative means to encode this signaling + information by overloading certain graphic characters (see, e.g., + [ISO646]) with additional meanings. Therefore, markup languages + allow for annotating a document in a syntactically distinguishable + way from the text, while keeping the annotations printable. Markup + languages are (reasonably) well-specified and tend to follow (mostly) + standardized syntax rules. Examples of formal markup languages + include Standard Generalized Markup Language (SGML), HTML, XML, and + LaTeX. Standardized rules lead to interoperability between markup + processors, but they impose skill requirements on new users that lead + to markup languages becoming less accessible to beginners. These + rules also reify "validity": content that does not conform to the + rules is treated differently (i.e., is rejected) than content that + conforms. + + + + +Leonard Informational [Page 2] + +RFC 7763 The text/markdown Media Type March 2016 + + + In contrast to formal markup languages, lightweight markup languages + use simple syntaxes; they are designed to be easy for humans to enter + and understand with basic text editors. Markdown, the subject of + this document, began as an /informal/ plain-text formatting syntax + [MDSYNTAX] and Perl script HTML/XHTML processor [MARKDOWN] targeted + at non-technical users using unspecialized tools, such as plain-text + email clients. [MDSYNTAX] explicitly rejects the notion of validity: + there is no such thing as "invalid" Markdown. If the Markdown + content does not result in the "right" output (defined as output that + the author wants, not output that adheres to some dictated system of + rules), the expectation is that the author should continue + experimenting by changing the content or the processor to achieve the + desired output. + + Since its development in 2004 [MARKDOWN], a number of web- and + Internet-facing applications have incorporated Markdown into their + text-entry systems, frequently with custom extensions. Markdown has + thus evolved into a kind of Internet meme [INETMEME] as different + communities encounter it and adapt the syntax for their specific use + cases. Markdown now represents a family of related plain-text + formatting syntaxes and implementations that, while broadly + compatible with humans [HUMANE], are intended to produce different + kinds of outputs that push the boundaries of mutual intelligibility + between software systems. + + To support identifying and conveying Markdown, this document defines + a media type and parameters that indicate the Markdown author's + intent on how to interpret the content. This registration draws + particular inspiration from text/troff [RFC4263], which is a plain- + text formatting syntax for typesetting based on tools from the 1960s + ("RUNOFF") and 1970s ("nroff", et al.). In that sense, Markdown is a + kind of troff for modern computing. A companion document [RFC7764] + provides additional Markdown background, philosophy, local storage + strategies, and variant registrations (including examples). + +1.2. Markdown Is About Writing and Editing + + "HTML is a *publishing* format; Markdown is a *writing* format. + Thus, Markdown's formatting syntax only addresses issues that can + be conveyed in plain text." [MDSYNTAX] + + The paradigmatic use case for text/markdown is the Markdown editor: + an application that presents Markdown content (which looks like an + email or other piece of plain-text writing) alongside a published + format, so that an author can see results instantaneously and can + tweak his or her input in real time. A significant number of + Markdown editors have adopted "split-screen view" (or "live preview") + technology that looks like Figure 1. + + + +Leonard Informational [Page 3] + +RFC 7763 The text/markdown Media Type March 2016 + + ++----------------------------------------------------------------------+ +| File Edit (Cloud Stuff) (Fork Me on GitHub) Help | ++----------------------------------------------------------------------+ +| [ such-and-such identifier ] [ useful statistics] | ++----------------------------------++----------------------------------+ +| (plain text, with || (text/html, likely | +| syntax highlighting) || rendered to screen) | +| || | +|# Introduction ||

Introduction

| +| || | +|## Markdown Is About Writing and /|

Markdown Is About Writing and | +/ Editing ||Editing

| +| || | +|> HTML is a *publishing* format; ||

HTML is a | +|> Markdown is a *writing* format. || publishing format; | +|> Thus, Markdown's formatting || Markdown is a writing | +|> syntax only addresses issues || format. Thus, Markdown's | +|> that can be conveyed in plain <> formatting syntax only addresses | +|> text. [MDSYNTAX][] || issues that can be conveyed in | +| || plain text. MDSYNTAX | +|presents Markdown content ||

| +|... || | +| ||

The paradigmatic use case for | +|[MDSYNTAX]: http://daringfireball./| text/markdown is the| +/net/projects/markdown/syntax#html || Markdown editor: an application | +|"Markdown: Syntax: HTML" || that presents Markdown content | +| || ...

| ++----------------------------------++----------------------------------+ + + LEGEND: "/" embedded in a vertical line represents a line-continuation + marker, since a line break is not supposed to occur in that content. + + Figure 1: Markdown Split-Screen / Live Preview Editor + + To get the best results, implementations ought to produce and consume + mutually intelligible and identifiable bits of Markdown. That way, + users on diverse platforms can collaborate with their tools of + choice. Those tools can be desktop-based (MarkdownPad, MultiMarkdown + Composer); browser-based (Dillinger, Markable); integrated widgets + (Discourse, GitHub); general-purpose editors (emacs, vi); or plain + old "Notepad". Additionally, implementations ought to have common + ways to identify particular areas of Markdown content when the + Markdown becomes appreciably large (e.g., book chapters and Internet- + Drafts -- not just blog posts). So that users have the option to use + Markdown in MIME-capable systems to convey their works in progress, + + + +Leonard Informational [Page 4] + +RFC 7763 The text/markdown Media Type March 2016 + + + not just their finished products (for which full-blown markups + ranging from text/html to application/pdf are appropriate), + implementations ought to label such Markdown content with a common + media type: text/markdown. This registration facilitates + interoperability between these Markdown editors by conveying the + syntax of the particular Markdown variant and the desired output + format. + +1.3. Definitions + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in [RFC2119]. + + Since Markdown signifies a family of related formats with varying + degrees of formal documentation and implementation, this + specification uses the term "variant" to identify such formats. + +2. Markdown Media Type Registration Application + + This section provides the media type registration application for the + text/markdown media type (see Section 5.6 of [RFC6838]). + + Type name: text + + Subtype name: markdown + + Required parameters: + + charset: Per Section 4.2.1 of [RFC6838], charset is REQUIRED. + There is no default value because neither [MDSYNTAX] nor many + popular implementations at the time of this registration do + either. [MDSYNTAX] clearly describes Markdown as a "writing + format"; its syntax rules operate on characters (specifically, + on punctuation) rather than code points. Many Markdown + processors will get along just fine by operating on characters + in the US-ASCII repertoire (specifically punctuation), + blissfully oblivious to other characters or codes. + + Optional parameters: + + variant: An optional identifier of the specific Markdown variant + that the author intended. The value serves as a "hint" to the + recipient, meaning that the recipient MAY interpret the + Markdown as that variant, but is under no obligation to do so. + When omitted, there is no hint; the interpretation is entirely + up to the receiver and context. This identifier is plain US- + ASCII and case-insensitive. To promote interoperability, + + + +Leonard Informational [Page 5] + +RFC 7763 The text/markdown Media Type March 2016 + + + identifiers can be registered in the registry defined in + Section 6. If a receiver does not recognize the variant + identifier, the receiver MAY present the identifier to a user + to inform him or her of it. + + Other parameters MAY be included with the media type. The + variant SHOULD define the semantics of such other parameters. + Additionally, the variant MAY be registered under another media + type; this text/markdown registration does not preclude other + registrations. + + Encoding considerations: + + Markdown content is plain-text content; any octet sequence is + valid as long as it conforms to the character codes of the charset + parameter. See [RFC2046]. Markup characters in [MDSYNTAX] are + limited to printable US-ASCII; however, other variants can define + markup characters outside this range (including control characters + such as NUL and characters encoded in multiple octets). + + Security considerations: + + Markdown interpreted as plain text is relatively harmless. A text + editor need only display the text. The editor SHOULD take care to + handle control characters appropriately and to limit the effect of + the Markdown to the text-editing area itself; malicious Unicode- + based Markdown could, for example, surreptitiously change the + directionality of the text. An editor for normal text would + already take these control characters into consideration, however. + + Markdown interpreted as a precursor to other formats, such as + HTML, carries all of the security considerations as the target + formats. For example, HTML can contain instructions to execute + scripts, redirect the user to other web pages, download remote + content, and upload personally identifiable information. Markdown + also can contain islands of formal markup, such as HTML. These + islands of formal markup may be passed as they are, transformed, + or ignored (perhaps because the islands are conditional or + incompatible) when the Markdown is processed. Since Markdown may + have different interpretations depending on the tool and the + environment, a better approach is to analyze (and sanitize or + block) the output markup, rather than attempting to analyze the + Markdown. + + + + + + + + +Leonard Informational [Page 6] + +RFC 7763 The text/markdown Media Type March 2016 + + + Interoperability considerations: + + Markdown variations (some might say "innovations") are designed to + be broadly compatible with humans ("humane"), but not necessarily + with each other. Therefore, syntax in one Markdown derivative may + be ignored or treated differently in another derivative. The + overall effect is a general degradation of the output that + increases with the quantity of variant-specific Markdown used in + the text. When it is desirable to reflect the author's intent in + the output, stick with the variant identified in the variant + parameter, i.e., receivers SHOULD only accept Markdown variants + that they explicitly know about, and senders SHOULD avoid use of + variants that intended recipients are not known to understand. + + Published specification: This specification; [MDSYNTAX]. + + Applications that use this media type: + + Markdown conversion tools, Markdown WYSIWYG (What You See is What + You Get) editors, and plain-text editors and viewers; markup + processor targets indirectly use Markdown (e.g., web browsers for + Markdown converted to HTML). + + Fragment identifier considerations: + + See Section 3. + + Additional information: + + Magic number(s): None + File extension(s): .md, .markdown + Macintosh file type code(s): + TEXT. A uniform type identifier (UTI) of + "net.daringfireball.markdown", which conforms to + "public.plain-text", is RECOMMENDED [MDUTI]. See [RFC7764] for + other considerations. + + Person & email address to contact for further information: + + Sean Leonard + + Restrictions on usage: None. + + Author/Change controller: Sean Leonard + + Intended usage: COMMON + + Provisional registration? No + + + +Leonard Informational [Page 7] + +RFC 7763 The text/markdown Media Type March 2016 + + + Implementations SHOULD record the value of the variant parameter (and + other parameters if defined by the variant) along with the Markdown + content when the content leaves the domain of formats that are + Internet media type capable. Strategies for doing so are discussed + in [RFC7764]. + + The Content-Disposition header (particularly the preview-type + parameter) can be used with Markdown content. See Section 4. + +3. Fragment Identifiers + + [MARKDOWN] does not define any fragment identifiers, but some + variants do, and many types of Markdown processor output (e.g., HTML + or PDF) will have well-defined fragment identifiers. Which fragment + identifiers are available for a given document are variant-defined. + + When encoded in a URI, characters that are outside of the fragment + production of [RFC3986] are percent-encoded. The default encoding + (character set) of percent-encoded octets in URIs is the same as the + Markdown content, which is identified by the charset parameter or by + other contextual means. Fragment identifiers SHOULD be considered + case-sensitive, which maintains consistency with HTML. Variants MAY + override the guidance in this paragraph. + + At least the first equals sign "=" SHOULD be percent-encoded to + prevent ambiguity as described in the following section. + +3.1. Parameters + + Similar to application/pdf [RFC3778] and text/plain [RFC5147], this + registration permits a parameter syntax for fragment identifiers. + The syntax is a parameter name, the equals sign "=" (which MUST NOT + be percent-encoded), and a parameter value. To the extent that + multiple parameters can appear in a fragment production, the + parameters SHALL be separated by the ampersand "&" (which MUST NOT be + percent-encoded). + + The only parameter defined in this registration is "line", which has + the same meaning as in [RFC5147], i.e., counting is zero-based. For + example: "#line=10" identifies the eleventh line of Markdown input. + Implementers should take heed that different environments and + character sets may have a wide range of code sequences to divide + lines. + + Markdown variants are free to define additional parameters. + + + + + + +Leonard Informational [Page 8] + +RFC 7763 The text/markdown Media Type March 2016 + + +4. Content Disposition and preview-type + + The Content-Disposition header [RFC2183] conveys presentational + information about a MIME entity, using a type and set of parameters. + The parameter preview-type is defined here for Markdown content. + + When present, preview-type indicates the Internet media type (and + parameters) of the preview output desired from the processor by the + author. With reference to the "paradigmatic use case" (i.e., + collaborative Markdown editing) in Section 1.3, the preview-type + parameter primarily affects the "right-hand" side of a Markdown + editor. There is no default value: when absent, a Markdown user + agent can render or display whatever it wants. + + The value of this parameter is an Internet media type with optional + parameters. The syntax (including case-sensitivity considerations) + is the same as specified in [RFC2045] for the Content-Type header + (with updates over time, e.g., [RFC2231] and [RFC6532]). + + Implementations SHOULD anticipate and support HTML (text/html) and + XHTML (application/xhtml+xml) output, to the extent that a syntax + targets those markup languages. These types ought to be suitable for + the majority of current purposes. However, Markdown is increasingly + becoming integral to workflows where HTML is not the target output; + examples range from TeX, to PDF, to Outline Processor Markup Language + (OPML), and even to entire e-books (e.g., [PANDOC]). + + The reflexive media type text/markdown in this parameter value means + that the author does not want to invoke Markdown processing at all: + the receiver SHOULD present the Markdown source as is. + + The preview-type parameter can be used for other types of content, + but the precise semantics are not defined here. + +5. Example + + The following is an example of Markdown as an email attachment: + + MIME-Version: 1.0 + Content-Type: text/markdown; charset=UTF-8; variant=Original + Content-Disposition: attachment; filename=readme.md; + preview-type="application/xhtml+xml" + + Sample HTML 4 Markdown + ============= + + This is some sample Markdown. [Hooray!][foo] + (Remember that link identifiers are not case-sensitive.) + + + +Leonard Informational [Page 9] + +RFC 7763 The text/markdown Media Type March 2016 + + + Bulleted Lists + ------- + + Here are some bulleted lists... + + * One Potato + * Two Potato + * Three Potato + + - One Tomato + - Two Tomato + - Three Tomato + + More Information + ----------- + + [.markdown, .md](http://daringfireball.net/projects/markdown/) + has more information. + + [fOo]: http://example.com/loc 'Will Not Work with Markdown.pl-1.0.1' + +6. IANA Considerations + + IANA has registered the media type text/markdown using the + application provided in Section 2 of this document. + + IANA has registered preview-type in the "Content Disposition + Parameters" subregistry of the "Content Disposition Values and + Parameters" registry, with the following description: "Internet media + type (and parameters) of the preview output desired from a processor + by the author of the MIME content". + +6.1. Markdown Variants + + IANA has established a registry called "Markdown Variants". While + the registry has been created in the context of the text/markdown + media type, the registry is intended for broad community use, so + protocols and systems that do not rely on Internet media types can + still tag Markdown content with a common variant identifier. Each + entry in this registry shall consist of basic information about the + variant: + + + + + + + + + + +Leonard Informational [Page 10] + +RFC 7763 The text/markdown Media Type March 2016 + + + Identifier: unique identifier for the variant + Name: the commonly known name of the variant + Description: a prose description of the variant, including + how it differs from other variants such as + Original + Additional Parameters*: additional Content-Type parameters + Fragment Identifiers*: additional fragment identifier syntaxes and + semantics + References: URIs or other references to documentation + Contact Information: whom to contact (email, URI, phone, address, + etc.) + Expiration Date^: when this provisional registration expires + + * (optional) + ^ (if provisional) + + While the variant parameter is "plain US-ASCII" (see registration + template), the Identifier field (and by implication, all registered + identifiers) SHALL conform to the ABNF [RFC5234]: + + ALPHA [*VCHAR (ALPHA / DIGIT)] + + For style and compatibility reasons, the Identifier field SHOULD + conform to the ABNF: + + ALPHA *( ["-" / "." / "_" / "~"] 1*(ALPHA / DIGIT) ) + + That is, the identifier MUST start with a letter and MAY contain + punctuation in the middle, but not at the end: the last character + MUST be alphanumeric. The second production uses the same characters + as the "unreserved" rule of [RFC3986] and is designed to be + compatible with characters in other identification systems, e.g., + filenames. Since the identifier MAY be displayed to a user -- + particularly in cases where the receiver does not recognize the + identifier -- the identifier SHOULD be rationally related to the + vernacular name of the variant. + + The Name, Description, Additional Parameters, Fragment Identifiers, + References, and Contact Information fields SHALL be in a Unicode + character set (e.g., UTF-8). + + The registry includes the registration in Section 6.1.4 (Original + Markdown). [RFC7764] includes additional registrations. + + + + + + + + +Leonard Informational [Page 11] + +RFC 7763 The text/markdown Media Type March 2016 + + +6.1.1. Reserved Identifiers + + The registry has the following identifiers RESERVED, as they have + engendered some controversy in the Markdown community. No one is + allowed to register them (or any case variations of them). These + identifiers are not and cannot be registered: + Standard + Common + Markdown + + The registry includes the following text in the note field: + The variant names Standard, Common, and Markdown are reserved and + cannot be registered. + +6.1.2. Standard of Review + + Registrations are made on a First Come, First Served [RFC5226] basis + by anyone with a need to interoperate. While documentation is + required, any level of documentation is sufficient; thus, neither + Specification Required nor Expert Review are warranted. The checks + prescribed by this section can be performed automatically. + + All references (including contact information) MUST be verified as + functional at the time of the registration. + + As a special "escape valve", registrations can be updated with IETF + Review [RFC5226]. All fields may be updated except the variant + identifier, which is permanent: not even case may be changed. + +6.1.3. Provisional Registration + + Any registrant may make a provisional registration to reserve a + variant identifier. Only the variant identifier and contact + information fields are required; the rest are optional. Provisional + registrations expire after three months, after which time the variant + identifier may be reused. To make a registration permanent, a + registrant simply needs to complete a permanent registration with the + same identifier as the provisional registration. + +6.1.4. Original Markdown + + The registry includes this initial variant. A conforming + implementation that processes the variant parameter MUST recognize + this variant (although the processing behavior is not defined here). + + Identifier: Original + + Name: Markdown + + + +Leonard Informational [Page 12] + +RFC 7763 The text/markdown Media Type March 2016 + + + Description: + Gruber's original Markdown syntax. + + References: + [MARKDOWN] + [MDSYNTAX] + + Contact Information: + (individual) John Gruber + + +7. Security Considerations + + See the Security considerations entry in Section 2. + +8. References + +8.1. Normative References + + [MARKDOWN] Gruber, J., "Daring Fireball: Markdown", December 2004, + . + + [MDSYNTAX] Gruber, J., "Daring Fireball: Markdown Syntax + Documentation", December 2004, + . + + [MDUTI] Gruber, J., "Daring Fireball: Uniform Type Identifier for + Markdown", August 2011, + . + + [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message + Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996, + . + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119, + DOI 10.17487/RFC2119, March 1997, + . + + [RFC2183] Troost, R., Dorner, S., and K. Moore, Ed., "Communicating + Presentation Information in Internet Messages: The + Content-Disposition Header Field", RFC 2183, + DOI 10.17487/RFC2183, August 1997, + . + + + + + +Leonard Informational [Page 13] + +RFC 7763 The text/markdown Media Type March 2016 + + + [RFC2231] Freed, N. and K. Moore, "MIME Parameter Value and Encoded + Word Extensions: Character Sets, Languages, and + Continuations", RFC 2231, DOI 10.17487/RFC2231, November + 1997, . + + [RFC3778] Taft, E., Pravetz, J., Zilles, S., and L. Masinter, "The + application/pdf Media Type", RFC 3778, + DOI 10.17487/RFC3778, May 2004, + . + + [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform + Resource Identifier (URI): Generic Syntax", STD 66, + RFC 3986, DOI 10.17487/RFC3986, January 2005, + . + + [RFC5147] Wilde, E. and M. Duerst, "URI Fragment Identifiers for the + text/plain Media Type", RFC 5147, DOI 10.17487/RFC5147, + April 2008, . + + [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an + IANA Considerations Section in RFCs", BCP 26, RFC 5226, + DOI 10.17487/RFC5226, May 2008, + . + + [RFC5234] Crocker, D., Ed., and P. Overell, "Augmented BNF for + Syntax Specifications: ABNF", STD 68, RFC 5234, + DOI 10.17487/RFC5234, January 2008, + . + + [RFC6532] Yang, A., Steele, S., and N. Freed, "Internationalized + Email Headers", RFC 6532, DOI 10.17487/RFC6532, February + 2012, . + + [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type + Specifications and Registration Procedures", BCP 13, + RFC 6838, DOI 10.17487/RFC6838, January 2013, + . + +8.2. Informative References + + [HUMANE] Atwood, J., "Is HTML a Humane Markup Language?", May 2008, + . + + + + + + + + +Leonard Informational [Page 14] + +RFC 7763 The text/markdown Media Type March 2016 + + + [INETMEME] Solon, O., "Richard Dawkins on the internet's hijacking of + the word 'meme'", June 2013, + , + . + + [ISO646] International Organization for Standardization, + "Information technology - ISO 7-bit coded character set + for information interchange", ISO Standard 646, 1991. + + [PANDOC] MacFarlane, J., "Pandoc", 2014, + . + + [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types", RFC 2046, + DOI 10.17487/RFC2046, November 1996, + . + + [RFC4263] Lilly, B., "Media Subtype Registration for Media Type + text/troff", RFC 4263, DOI 10.17487/RFC4263, January 2006, + . + + [RFC7764] Leonard, S., "Guidance on Markdown: Design Philosophies, + Stability Strategies, and Select Registrations", RFC 7764, + DOI 10.17487/RFC7764, March 2016, + . + + [UNICODE] The Unicode Consortium, "The Unicode Standard, Version + 8.0", (Mountain View, CA: The Unicode Consortium, 2015. + ISBN 978-1-936213-10-8), + . + +Author's Address + + Sean Leonard + Penango, Inc. + 5900 Wilshire Boulevard + 21st Floor + Los Angeles, CA 90036 + United States + + Email: dev+ietf@seantek.com + URI: http://www.penango.com/ + + + + + + + + +Leonard Informational [Page 15] + diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc8259-json.txt b/docs/research/non-pdf-dom-evidence/standards/rfc8259-json.txt new file mode 100644 index 000000000..f1adf81e3 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc8259-json.txt @@ -0,0 +1,899 @@ + + + + + + +Internet Engineering Task Force (IETF) T. Bray, Ed. +Request for Comments: 8259 Textuality +Obsoletes: 7159 December 2017 +Category: Standards Track +ISSN: 2070-1721 + + + The JavaScript Object Notation (JSON) Data Interchange Format + +Abstract + + JavaScript Object Notation (JSON) is a lightweight, text-based, + language-independent data interchange format. It was derived from + the ECMAScript Programming Language Standard. JSON defines a small + set of formatting rules for the portable representation of structured + data. + + This document removes inconsistencies with other specifications of + JSON, repairs specification errors, and offers experience-based + interoperability guidance. + +Status of This Memo + + This is an Internet Standards Track document. + + This document is a product of the Internet Engineering Task Force + (IETF). It represents the consensus of the IETF community. It has + received public review and has been approved for publication by the + Internet Engineering Steering Group (IESG). Further information on + Internet Standards is available in Section 2 of RFC 7841. + + Information about the current status of this document, any errata, + and how to provide feedback on it may be obtained at + https://www.rfc-editor.org/info/rfc8259. + + + + + + + + + + + + + + + + + +Bray Standards Track [Page 1] + +RFC 8259 JSON December 2017 + + +Copyright Notice + + Copyright (c) 2017 IETF Trust and the persons identified as the + document authors. All rights reserved. + + This document is subject to BCP 78 and the IETF Trust's Legal + Provisions Relating to IETF Documents + (https://trustee.ietf.org/license-info) in effect on the date of + publication of this document. Please review these documents + carefully, as they describe your rights and restrictions with respect + to this document. Code Components extracted from this document must + include Simplified BSD License text as described in Section 4.e of + the Trust Legal Provisions and are provided without warranty as + described in the Simplified BSD License. + + This document may contain material from IETF Documents or IETF + Contributions published or made publicly available before November + 10, 2008. The person(s) controlling the copyright in some of this + material may not have granted the IETF Trust the right to allow + modifications of such material outside the IETF Standards Process. + Without obtaining an adequate license from the person(s) controlling + the copyright in such materials, this document may not be modified + outside the IETF Standards Process, and derivative works of it may + not be created outside the IETF Standards Process, except to format + it for publication as an RFC or to translate it into languages other + than English. + + + + + + + + + + + + + + + + + + + + + + + + + +Bray Standards Track [Page 2] + +RFC 8259 JSON December 2017 + + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 + 1.1. Conventions Used in This Document . . . . . . . . . . . . 4 + 1.2. Specifications of JSON . . . . . . . . . . . . . . . . . 4 + 1.3. Introduction to This Revision . . . . . . . . . . . . . . 5 + 2. JSON Grammar . . . . . . . . . . . . . . . . . . . . . . . . 5 + 3. Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 + 4. Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 + 5. Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 + 6. Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 + 7. Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 + 8. String and Character Issues . . . . . . . . . . . . . . . . . 9 + 8.1. Character Encoding . . . . . . . . . . . . . . . . . . . 9 + 8.2. Unicode Characters . . . . . . . . . . . . . . . . . . . 10 + 8.3. String Comparison . . . . . . . . . . . . . . . . . . . . 10 + 9. Parsers . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 + 10. Generators . . . . . . . . . . . . . . . . . . . . . . . . . 10 + 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 + 12. Security Considerations . . . . . . . . . . . . . . . . . . . 12 + 13. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 12 + 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 + 14.1. Normative References . . . . . . . . . . . . . . . . . . 14 + 14.2. Informative References . . . . . . . . . . . . . . . . . 14 + Appendix A. Changes from RFC 7159 . . . . . . . . . . . . . . . 16 + Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 16 + Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 + +1. Introduction + + JavaScript Object Notation (JSON) is a text format for the + serialization of structured data. It is derived from the object + literals of JavaScript, as defined in the ECMAScript Programming + Language Standard, Third Edition [ECMA-262]. + + JSON can represent four primitive types (strings, numbers, booleans, + and null) and two structured types (objects and arrays). + + A string is a sequence of zero or more Unicode characters [UNICODE]. + Note that this citation references the latest version of Unicode + rather than a specific release. It is not expected that future + changes in the Unicode specification will impact the syntax of JSON. + + An object is an unordered collection of zero or more name/value + pairs, where a name is a string and a value is a string, number, + boolean, null, object, or array. + + An array is an ordered sequence of zero or more values. + + + +Bray Standards Track [Page 3] + +RFC 8259 JSON December 2017 + + + The terms "object" and "array" come from the conventions of + JavaScript. + + JSON's design goals were for it to be minimal, portable, textual, and + a subset of JavaScript. + +1.1. Conventions Used in This Document + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and + "OPTIONAL" in this document are to be interpreted as described in BCP + 14 [RFC2119] [RFC8174] when, and only when, they appear in all + capitals, as shown here. + + The grammatical rules in this document are to be interpreted as + described in [RFC5234]. + +1.2. Specifications of JSON + + This document replaces [RFC7159]. [RFC7159] obsoleted [RFC4627], + which originally described JSON and registered the media type + "application/json". + + JSON is also described in [ECMA-404]. + + The reference to ECMA-404 in the previous sentence is normative, not + with the usual meaning that implementors need to consult it in order + to understand this document, but to emphasize that there are no + inconsistencies in the definition of the term "JSON text" in any of + its specifications. Note, however, that ECMA-404 allows several + practices that this specification recommends avoiding in the + interests of maximal interoperability. + + The intent is that the grammar is the same between the two documents, + although different descriptions are used. If there is a difference + found between them, ECMA and the IETF will work together to update + both documents. + + If an error is found with either document, the other should be + examined to see if it has a similar error; if it does, it should be + fixed, if possible. + + If either document is changed in the future, ECMA and the IETF will + work together to ensure that the two documents stay aligned through + the change. + + + + + + +Bray Standards Track [Page 4] + +RFC 8259 JSON December 2017 + + +1.3. Introduction to This Revision + + In the years since the publication of RFC 4627, JSON has found very + wide use. This experience has revealed certain patterns that, while + allowed by its specifications, have caused interoperability problems. + + Also, a small number of errata have been reported regarding RFC 4627 + (see RFC Errata IDs 607 [Err607] and 3607 [Err3607]) and regarding + RFC 7159 (see RFC Errata IDs 3915 [Err3915], 4264 [Err4264], 4336 + [Err4336], and 4388 [Err4388]). + + This document's goal is to apply the errata, remove inconsistencies + with other specifications of JSON, and highlight practices that can + lead to interoperability problems. + +2. JSON Grammar + + A JSON text is a sequence of tokens. The set of tokens includes six + structural characters, strings, numbers, and three literal names. + + A JSON text is a serialized value. Note that certain previous + specifications of JSON constrained a JSON text to be an object or an + array. Implementations that generate only objects or arrays where a + JSON text is called for will be interoperable in the sense that all + implementations will accept these as conforming JSON texts. + + JSON-text = ws value ws + + These are the six structural characters: + + begin-array = ws %x5B ws ; [ left square bracket + + begin-object = ws %x7B ws ; { left curly bracket + + end-array = ws %x5D ws ; ] right square bracket + + end-object = ws %x7D ws ; } right curly bracket + + name-separator = ws %x3A ws ; : colon + + value-separator = ws %x2C ws ; , comma + + + + + + + + + + +Bray Standards Track [Page 5] + +RFC 8259 JSON December 2017 + + + Insignificant whitespace is allowed before or after any of the six + structural characters. + + ws = *( + %x20 / ; Space + %x09 / ; Horizontal tab + %x0A / ; Line feed or New line + %x0D ) ; Carriage return + +3. Values + + A JSON value MUST be an object, array, number, or string, or one of + the following three literal names: + + false + null + true + + The literal names MUST be lowercase. No other literal names are + allowed. + + value = false / null / true / object / array / number / string + + false = %x66.61.6c.73.65 ; false + + null = %x6e.75.6c.6c ; null + + true = %x74.72.75.65 ; true + +4. Objects + + An object structure is represented as a pair of curly brackets + surrounding zero or more name/value pairs (or members). A name is a + string. A single colon comes after each name, separating the name + from the value. A single comma separates a value from a following + name. The names within an object SHOULD be unique. + + object = begin-object [ member *( value-separator member ) ] + end-object + + member = string name-separator value + + An object whose names are all unique is interoperable in the sense + that all software implementations receiving that object will agree on + the name-value mappings. When the names within an object are not + unique, the behavior of software that receives such an object is + unpredictable. Many implementations report the last name/value pair + only. Other implementations report an error or fail to parse the + + + +Bray Standards Track [Page 6] + +RFC 8259 JSON December 2017 + + + object, and some implementations report all of the name/value pairs, + including duplicates. + + JSON parsing libraries have been observed to differ as to whether or + not they make the ordering of object members visible to calling + software. Implementations whose behavior does not depend on member + ordering will be interoperable in the sense that they will not be + affected by these differences. + +5. Arrays + + An array structure is represented as square brackets surrounding zero + or more values (or elements). Elements are separated by commas. + + array = begin-array [ value *( value-separator value ) ] end-array + + There is no requirement that the values in an array be of the same + type. + +6. Numbers + + The representation of numbers is similar to that used in most + programming languages. A number is represented in base 10 using + decimal digits. It contains an integer component that may be + prefixed with an optional minus sign, which may be followed by a + fraction part and/or an exponent part. Leading zeros are not + allowed. + + A fraction part is a decimal point followed by one or more digits. + + An exponent part begins with the letter E in uppercase or lowercase, + which may be followed by a plus or minus sign. The E and optional + sign are followed by one or more digits. + + Numeric values that cannot be represented in the grammar below (such + as Infinity and NaN) are not permitted. + + number = [ minus ] int [ frac ] [ exp ] + + decimal-point = %x2E ; . + + digit1-9 = %x31-39 ; 1-9 + + e = %x65 / %x45 ; e E + + exp = e [ minus / plus ] 1*DIGIT + + frac = decimal-point 1*DIGIT + + + +Bray Standards Track [Page 7] + +RFC 8259 JSON December 2017 + + + int = zero / ( digit1-9 *DIGIT ) + + minus = %x2D ; - + + plus = %x2B ; + + + zero = %x30 ; 0 + + This specification allows implementations to set limits on the range + and precision of numbers accepted. Since software that implements + IEEE 754 binary64 (double precision) numbers [IEEE754] is generally + available and widely used, good interoperability can be achieved by + implementations that expect no more precision or range than these + provide, in the sense that implementations will approximate JSON + numbers within the expected precision. A JSON number such as 1E400 + or 3.141592653589793238462643383279 may indicate potential + interoperability problems, since it suggests that the software that + created it expects receiving software to have greater capabilities + for numeric magnitude and precision than is widely available. + + Note that when such software is used, numbers that are integers and + are in the range [-(2**53)+1, (2**53)-1] are interoperable in the + sense that implementations will agree exactly on their numeric + values. + +7. Strings + + The representation of strings is similar to conventions used in the C + family of programming languages. A string begins and ends with + quotation marks. All Unicode characters may be placed within the + quotation marks, except for the characters that MUST be escaped: + quotation mark, reverse solidus, and the control characters (U+0000 + through U+001F). + + Any character may be escaped. If the character is in the Basic + Multilingual Plane (U+0000 through U+FFFF), then it may be + represented as a six-character sequence: a reverse solidus, followed + by the lowercase letter u, followed by four hexadecimal digits that + encode the character's code point. The hexadecimal letters A through + F can be uppercase or lowercase. So, for example, a string + containing only a single reverse solidus character may be represented + as "\u005C". + + Alternatively, there are two-character sequence escape + representations of some popular characters. So, for example, a + string containing only a single reverse solidus character may be + represented more compactly as "\\". + + + + +Bray Standards Track [Page 8] + +RFC 8259 JSON December 2017 + + + To escape an extended character that is not in the Basic Multilingual + Plane, the character is represented as a 12-character sequence, + encoding the UTF-16 surrogate pair. So, for example, a string + containing only the G clef character (U+1D11E) may be represented as + "\uD834\uDD1E". + + string = quotation-mark *char quotation-mark + + char = unescaped / + escape ( + %x22 / ; " quotation mark U+0022 + %x5C / ; \ reverse solidus U+005C + %x2F / ; / solidus U+002F + %x62 / ; b backspace U+0008 + %x66 / ; f form feed U+000C + %x6E / ; n line feed U+000A + %x72 / ; r carriage return U+000D + %x74 / ; t tab U+0009 + %x75 4HEXDIG ) ; uXXXX U+XXXX + + escape = %x5C ; \ + + quotation-mark = %x22 ; " + + unescaped = %x20-21 / %x23-5B / %x5D-10FFFF + +8. String and Character Issues + +8.1. Character Encoding + + JSON text exchanged between systems that are not part of a closed + ecosystem MUST be encoded using UTF-8 [RFC3629]. + + Previous specifications of JSON have not required the use of UTF-8 + when transmitting JSON text. However, the vast majority of JSON- + based software implementations have chosen to use the UTF-8 encoding, + to the extent that it is the only encoding that achieves + interoperability. + + Implementations MUST NOT add a byte order mark (U+FEFF) to the + beginning of a networked-transmitted JSON text. In the interests of + interoperability, implementations that parse JSON texts MAY ignore + the presence of a byte order mark rather than treating it as an + error. + + + + + + + +Bray Standards Track [Page 9] + +RFC 8259 JSON December 2017 + + +8.2. Unicode Characters + + When all the strings represented in a JSON text are composed entirely + of Unicode characters [UNICODE] (however escaped), then that JSON + text is interoperable in the sense that all software implementations + that parse it will agree on the contents of names and of string + values in objects and arrays. + + However, the ABNF in this specification allows member names and + string values to contain bit sequences that cannot encode Unicode + characters; for example, "\uDEAD" (a single unpaired UTF-16 + surrogate). Instances of this have been observed, for example, when + a library truncates a UTF-16 string without checking whether the + truncation split a surrogate pair. The behavior of software that + receives JSON texts containing such values is unpredictable; for + example, implementations might return different values for the length + of a string value or even suffer fatal runtime exceptions. + +8.3. String Comparison + + Software implementations are typically required to test names of + object members for equality. Implementations that transform the + textual representation into sequences of Unicode code units and then + perform the comparison numerically, code unit by code unit, are + interoperable in the sense that implementations will agree in all + cases on equality or inequality of two strings. For example, + implementations that compare strings with escaped characters + unconverted may incorrectly find that "a\\b" and "a\u005Cb" are not + equal. + +9. Parsers + + A JSON parser transforms a JSON text into another representation. A + JSON parser MUST accept all texts that conform to the JSON grammar. + A JSON parser MAY accept non-JSON forms or extensions. + + An implementation may set limits on the size of texts that it + accepts. An implementation may set limits on the maximum depth of + nesting. An implementation may set limits on the range and precision + of numbers. An implementation may set limits on the length and + character contents of strings. + +10. Generators + + A JSON generator produces JSON text. The resulting text MUST + strictly conform to the JSON grammar. + + + + + +Bray Standards Track [Page 10] + +RFC 8259 JSON December 2017 + + +11. IANA Considerations + + The media type for JSON text is application/json. + + Type name: application + + Subtype name: json + + Required parameters: n/a + + Optional parameters: n/a + + Encoding considerations: binary + + Security considerations: See RFC 8259, Section 12 + + Interoperability considerations: Described in RFC 8259 + + Published specification: RFC 8259 + + Applications that use this media type: + JSON has been used to exchange data between applications written + in all of these programming languages: ActionScript, C, C#, + Clojure, ColdFusion, Common Lisp, E, Erlang, Go, Java, JavaScript, + Lua, Objective CAML, Perl, PHP, Python, Rebol, Ruby, Scala, and + Scheme. + + Additional information: + Magic number(s): n/a + File extension(s): .json + Macintosh file type code(s): TEXT + + Person & email address to contact for further information: + IESG + + + Intended usage: COMMON + + Restrictions on usage: none + + Author: + Douglas Crockford + + + Change controller: + IESG + + + + + +Bray Standards Track [Page 11] + +RFC 8259 JSON December 2017 + + + Note: No "charset" parameter is defined for this registration. + Adding one really has no effect on compliant recipients. + +12. Security Considerations + + Generally, there are security issues with scripting languages. JSON + is a subset of JavaScript but excludes assignment and invocation. + + Since JSON's syntax is borrowed from JavaScript, it is possible to + use that language's "eval()" function to parse most JSON texts (but + not all; certain characters such as U+2028 LINE SEPARATOR and U+2029 + PARAGRAPH SEPARATOR are legal in JSON but not JavaScript). This + generally constitutes an unacceptable security risk, since the text + could contain executable code along with data declarations. The same + consideration applies to the use of eval()-like functions in any + other programming language in which JSON texts conform to that + language's syntax. + +13. Examples + + This is a JSON object: + + { + "Image": { + "Width": 800, + "Height": 600, + "Title": "View from 15th Floor", + "Thumbnail": { + "Url": "http://www.example.com/image/481989943", + "Height": 125, + "Width": 100 + }, + "Animated" : false, + "IDs": [116, 943, 234, 38793] + } + } + + Its Image member is an object whose Thumbnail member is an object and + whose IDs member is an array of numbers. + + + + + + + + + + + + +Bray Standards Track [Page 12] + +RFC 8259 JSON December 2017 + + + This is a JSON array containing two objects: + + [ + { + "precision": "zip", + "Latitude": 37.7668, + "Longitude": -122.3959, + "Address": "", + "City": "SAN FRANCISCO", + "State": "CA", + "Zip": "94107", + "Country": "US" + }, + { + "precision": "zip", + "Latitude": 37.371991, + "Longitude": -122.026020, + "Address": "", + "City": "SUNNYVALE", + "State": "CA", + "Zip": "94085", + "Country": "US" + } + ] + + Here are three small JSON texts containing only values: + + "Hello world!" + + 42 + + true + + + + + + + + + + + + + + + + + + + +Bray Standards Track [Page 13] + +RFC 8259 JSON December 2017 + + +14. References + +14.1. Normative References + + [ECMA-404] Ecma International, "The JSON Data Interchange Format", + Standard ECMA-404, + . + + [IEEE754] IEEE, "IEEE Standard for Floating-Point Arithmetic", + IEEE 754. + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119, + DOI 10.17487/RFC2119, March 1997, + . + + [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO + 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November + 2003, . + + [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax + Specifications: ABNF", STD 68, RFC 5234, + DOI 10.17487/RFC5234, January 2008, + . + + [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC + 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, + May 2017, . + + [UNICODE] The Unicode Consortium, "The Unicode Standard", + . + +14.2. Informative References + + [ECMA-262] Ecma International, "ECMAScript Language Specification", + Standard ECMA-262, Third Edition, December 1999, + . + + [Err3607] RFC Errata, Erratum ID 3607, RFC 4627, + . + + [Err3915] RFC Errata, Erratum ID 3915, RFC 7159, + . + + + + + +Bray Standards Track [Page 14] + +RFC 8259 JSON December 2017 + + + [Err4264] RFC Errata, Erratum ID 4264, RFC 7159, + . + + [Err4336] RFC Errata, Erratum ID 4336, RFC 7159, + . + + [Err4388] RFC Errata, Erratum ID 4388, RFC 7159, + . + + [Err607] RFC Errata, Erratum ID 607, RFC 4627, + . + + [RFC4627] Crockford, D., "The application/json Media Type for + JavaScript Object Notation (JSON)", RFC 4627, + DOI 10.17487/RFC4627, July 2006, + . + + [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data + Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March + 2014, . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Bray Standards Track [Page 15] + +RFC 8259 JSON December 2017 + + +Appendix A. Changes from RFC 7159 + + This section lists changes between this document and the text in + RFC 7159. + + o Section 1.2 has been updated to reflect the removal of a JSON + specification from ECMA-262, to make ECMA-404 a normative + reference, and to explain the particular meaning of "normative". + + o Section 1.3 has been updated to reflect errata filed against + RFC 7159, not RFC 4627. + + o Section 8.1 was changed to require the use of UTF-8 when + transmitted over a network. + + o Section 12 has been updated to increase the precision of the + description of the security risk that follows from using the + ECMAScript "eval()" function. + + o Section 14.1 has been updated to include ECMA-404 as a normative + reference. + + o Section 14.2 has been updated to remove ECMA-404, update the + version of ECMA-262, and refresh the errata list. + +Contributors + + RFC 4627 was written by Douglas Crockford. This document was + constructed by making a relatively small number of changes to that + document; thus, the vast majority of the text here is his. + +Author's Address + + Tim Bray (editor) + Textuality + + Email: tbray@textuality.com + + + + + + + + + + + + + + +Bray Standards Track [Page 16] + diff --git a/docs/research/non-pdf-dom-evidence/standards/rfc9073-icalendar-event-publishing-extensions.txt b/docs/research/non-pdf-dom-evidence/standards/rfc9073-icalendar-event-publishing-extensions.txt new file mode 100644 index 000000000..b712af7b0 --- /dev/null +++ b/docs/research/non-pdf-dom-evidence/standards/rfc9073-icalendar-event-publishing-extensions.txt @@ -0,0 +1,1453 @@ + + + + +Internet Engineering Task Force (IETF) M. Douglass +Request for Comments: 9073 Bedework +Updates: 5545 August 2021 +Category: Standards Track +ISSN: 2070-1721 + + + Event Publishing Extensions to iCalendar + +Abstract + + This specification updates RFC 5545 by introducing a number of new + iCalendar properties and components that are of particular use for + event publishers and in social networking. + + This specification also defines a new "STRUCTURED-DATA" property for + iCalendar (RFC 5545) to allow for data that is directly pertinent to + an event or task to be included with the calendar data. + +Status of This Memo + + This is an Internet Standards Track document. + + This document is a product of the Internet Engineering Task Force + (IETF). It represents the consensus of the IETF community. It has + received public review and has been approved for publication by the + Internet Engineering Steering Group (IESG). Further information on + Internet Standards is available in Section 2 of RFC 7841. + + Information about the current status of this document, any errata, + and how to provide feedback on it may be obtained at + https://www.rfc-editor.org/info/rfc9073. + +Copyright Notice + + Copyright (c) 2021 IETF Trust and the persons identified as the + document authors. All rights reserved. + + This document is subject to BCP 78 and the IETF Trust's Legal + Provisions Relating to IETF Documents + (https://trustee.ietf.org/license-info) in effect on the date of + publication of this document. Please review these documents + carefully, as they describe your rights and restrictions with respect + to this document. Code Components extracted from this document must + include Simplified BSD License text as described in Section 4.e of + the Trust Legal Provisions and are provided without warranty as + described in the Simplified BSD License. + +Table of Contents + + 1. Introduction + 1.1. Conventions Used in This Document + 1.2. Terms Used in This Document + 2. Components and Properties + 3. Typed References + 3.1. Use Cases + 3.1.1. Piano Concert Performance + 3.1.2. Itineraries + 3.1.2.1. Reserving Facilities + 4. Modifications to Calendar Components + 5. New Property Parameters + 5.1. Order + 5.2. Schema + 5.3. Derived + 6. New Properties + 6.1. Location Type + 6.2. Participant Type + 6.3. Resource Type + 6.4. Calendar Address + 6.5. Styled-Description + 6.6. Structured-Data + 7. New Components + 7.1. Participant + 7.1.1. Schedulable Participant + 7.2. Location + 7.3. Resource + 8. Extended Examples + 8.1. Example 1 + 8.2. Example 2 + 9. Security Considerations + 9.1. URIs + 9.2. Malicious Content + 9.3. HTML Content + 10. Privacy Considerations + 10.1. Tracking + 10.2. Revealing Locations + 11. IANA Considerations + 11.1. Additional iCalendar Registrations + 11.1.1. Properties + 11.1.2. Parameters + 11.1.3. Components + 11.2. Participant Types and Resource Types Registries + 11.2.1. Participant Types + 11.2.2. Resource Types + 12. Normative References + Acknowledgements + Author's Address + +1. Introduction + + The currently existing iCalendar standard [RFC5545] lacks useful + methods for referencing additional, external information relating to + calendar components. Additionally, there is no standard way to + provide rich-text descriptions or metadata associated with the event. + + Current practice is to embed this information as links in the + description or to add nonstandard properties, as defined in + Section 3.8.8.2 of [RFC5545]. + + This document updates [RFC5545] to define a number of properties and + components referencing such external information that can provide + additional information about an iCalendar component. The intent is + to allow the interchange of such information between applications or + systems (e.g., between clients, between client and server, and + between servers). Formats, such as vCard [RFC6350], are likely to be + most useful to the receivers of such events as they may be used in + other applications -- such as address books. + +1.1. Conventions Used in This Document + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and + "OPTIONAL" in this document are to be interpreted as described in + BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all + capitals, as shown here. + + The notation used in this memo is the ABNF notation of [RFC5234] as + used by iCalendar [RFC5545]. Any syntax elements shown below that + are not explicitly defined in this specification come from iCalendar + [RFC5545]. + +1.2. Terms Used in This Document + + Event: When the word 'event' (perhaps with a capitalized 'E') is + used, we are referring to gatherings, formal or informal (for + example, a sports event, a party, or a concert). + + Social Calendaring: Historically, calendar data and scheduling has + been heavily biased towards meetings in a corporate environment. + Some of the features defined in this document are to support a + more informal, i.e., social, model. For example, we may want to + record who is participating in a public event. + +2. Components and Properties + + Previous extensions to the calendaring standards have been largely + restricted to the addition of properties or parameters. This is + partly because iCalendar libraries had trouble handling components + nested deeper than those defined in [RFC5545]. + + In a break with this 'convention', this specification defines a + number of components rather than properties. This is a better match + for the way [W3C.REC-xml-20081126] and JSON [RFC8259] handle such + structures and allows richer definitions. + + It also allows for the addition of extra properties inside the + components and resolves some of the problems of trying to add + detailed information as a parameter. + +3. Typed References + + The properties and components defined here can all reference external + metadata, which may be used by applications to provide further + information to users. By providing type information, clients and + servers are able to discover interesting references and make use of + them, perhaps for indexing or presenting additional, related + information for the user. + + As always, clients should exercise caution in following references to + external data. + + The "LOCATION" property [RFC5545] provides only an unstructured + single text value for specifying the location where an event (or + task) will occur. This is inadequate for use cases where structured + location information (e.g., address, region, country, or postal code) + is required or preferred and limits widespread adoption of iCalendar + in those settings. + + Using the "VLOCATION" component, rich information about multiple + locations can be communicated in a "STRUCTURED-DATA" property; + examples include address, region, country, postal code, parking + availability, nearby restaurants, and the venue, among others. + Servers and clients can retrieve the objects when storing the event + and use them to index by geographic location. + + When a calendar client receives a calendar component, it can search + the set of locations looking for those of particular interest. The + "LOCATION-TYPE" property and "FMTTYPE" parameter applied to the + "STRUCTURED-DATA" property, if supplied, can be used to help the + selection. + + The "PARTICIPANT" component is designed to handle common use cases in + event publication. It is generally important to provide information + about the organizers of such events. Sponsors wish to be referenced + in a prominent manner. In social calendaring, it is often important + to identify the active participants (e.g,, a school sports team) and + the inactive participants (e.g., the parents) in the event. + + The "PARTICIPANT" component can be used to provide useful extra data + about an attendee. For example, a location inside the PARTICIPANT + gives the actual location of a remote attendee. (But see the note + about privacy.) + + Alternatively, the "PARTICIPANT" component can be used to provide a + reference -- perhaps the address for mailing lists. + +3.1. Use Cases + + The main motivation for these changes has been event publication, but + there are opportunities for use elsewhere. The following use cases + will describe some possible scenarios. + +3.1.1. Piano Concert Performance + + In putting together a concert, there are many participants: piano + tuner, performer, stage hands, etc. In addition, there are sponsors + and various contacts to be provided. There will also be a number of + related locations. A number of events can be created, all of which + relate to the performance in different ways. + + There may be an iCalendar Transport-independent Interoperability + Protocol (iTIP) [RFC5546] meeting request for the piano tuner, who + will arrive before the performance. Other members of staff may also + receive meeting requests. + + An event can also be created for publication, which will have a + "PARTICIPANT" component for the pianist providing a reference to + vCard information ([RFC6350]) about the performer. This event would + also hold information about parking, local subway stations, and the + venue itself. In addition, there may be sponsorship information for + sponsors of the event and perhaps paid sponsorship properties, + essentially advertising local establishments. + +3.1.2. Itineraries + + These additions also provide opportunities for the travel industry. + When booking a flight, the "PARTICIPANT" component can be used to + provide references to businesses at the airports and to rental car + businesses at the destination. + + The embedded location information can guide the traveler around the + airport itself or to their final destination. The contact + information can provide detailed information about the booking agent, + airlines, car hire companies, and hotel. + +3.1.2.1. Reserving Facilities + + For a meeting, the size of a room and the equipment needed depends, + to some extent, on the number of attendees actually in the room. + + A meeting may have many attendees, none of which are co-located. The + current "ATTENDEE" property does not allow for the addition of such + metadata. The "PARTICIPANT" component allows attendees to specify + their location. + +4. Modifications to Calendar Components + + The following changes to the syntax defined in iCalendar [RFC5545] + are made here. New elements are defined in subsequent sections. + + ; Addition of PARTICIPANT, VLOCATION, and VRESOURCE + ; as valid components + eventc = "BEGIN" ":" "VEVENT" CRLF + eventprop *alarmc *participantc *locationc *resourcec + "END" ":" "VEVENT" CRLF + + ; Addition of properties STYLED-DESCRIPTION and STRUCTURED-DATA + eventprop =/ *styleddescription + *sdataprop + + ; Addition of PARTICIPANT, VLOCATION, and VRESOURCE + ; as valid components + todoc = "BEGIN" ":" "VTODO" CRLF + todoprop *alarmc *participantc *locationc *resourcec + "END" ":" "VTODO" CRLF + + ; Addition of properties STYLED-DESCRIPTION and STRUCTURED-DATA + todoprop =/ *styleddescription + *sdataprop + + ; Addition of PARTICIPANT, VLOCATION, and VRESOURCE + ; as valid components + journalc = "BEGIN" ":" "VJOURNAL" CRLF + jourprop *participantc *locationc *resourcec + "END" ":" "VJOURNAL" CRLF + + ; Addition of properties STYLED-DESCRIPTION and STRUCTURED-DATA + jourprop =/ *styleddescription + *sdataprop + + ; Addition of PARTICIPANT, VLOCATION, and VRESOURCE + ; as valid components + freebusyc = "BEGIN" ":" "VFREEBUSY" CRLF + fbprop *participantc *locationc *resourcec + "END" ":" "VFREEBUSY" CRLF + + ; Addition of property STYLED-DESCRIPTION + fbprop =/ *styleddescription + +5. New Property Parameters + +5.1. Order + + Parameter name: ORDER + + Purpose: This parameter defines ordering for the associated + property. + + Format Definition: This parameter is defined by the following + notation: + + orderparam = "ORDER" "=" integer + ; Must be greater than or equal to 1 + + Description: The "ORDER" parameter is OPTIONAL and is used to + indicate the relative ordering of the corresponding instance of a + property. Its value MUST be an integer greater than or equal to 1 + that specifies the order, with 1 being the first in the ordering. + + When the parameter is absent, the default MUST be to interpret the + property instance as being ordered last, that is, the property + will appear after any other instances of the same property with + any value of ORDER. + + When any "ORDER" parameters have the same value, all the + associated properties appear as a group within which there is no + defined order. + + Note that the value of this parameter is to be interpreted only in + relation to values assigned to other corresponding instances of + the same property in the same entity. + + This parameter MUST NOT be applied to a property that does not + allow multiple instances. + + Example uses: The ORDER may be applied to the "PARTICIPANT-TYPE" + property to indicate the relative importance of the participant, + for example, as a sponsor or a performer. For example, ORDER=1 + could define the principal performer or soloist. + +5.2. Schema + + Parameter Name: SCHEMA + + Purpose: This parameter specifies the schema used for the content of + a "STRUCTURED-DATA" property value. + + Format Definition: This parameter is defined by the following + notation: + + schemaparam = "SCHEMA" "=" DQUOTE uri DQUOTE + + Description: This property parameter SHOULD be specified on + "STRUCTURED-DATA" properties. When present, it provides + identifying information about the nature of the content of the + corresponding "STRUCTURED-DATA" property value. This can be used + to supplement the media type information provided by the "FMTTYPE" + parameter on the corresponding property. + + Example: + STRUCTURED-DATA;FMTTYPE=application/ld+json; + SCHEMA="https://schema.org/FlightReservation"; + ENCODING=BASE64;VALUE=BINARY:ICAgIDxzY3JpcHQgdHlwZT0iYXBwb + GljYXRpb24vbGQranNvbiI+CiAgICB7CiAgICAgICJAY29 + udGV4dCI6ICJodHRwOi8vc2NoZW1hLm9yZyIsCiAgICAgICJAdHlwZSI + 6ICJGbGlnaHRSZXNlcnZhdGlvbiIsCiAgICAgICJyZXNlcnZhdGlvbkl + kIjogIlJYSjM0UCIsCiAgICAgICJyZXNlcnZhdGlvblN0YXR1cyI6ICJ + odHRwOi8vc2NoZW1hLm9yZy9SZXNlcnZhdGlvbkNvbmZpcm1lZCIsCiA + gICAgICJwYXNzZW5nZXJQcmlvcml0eVN0YXR1cyI6ICJGYXN0IFRyYWN + rIiwKICAgICAgInBhc3NlbmdlclNlcXVlbmNlTnVtYmVyIjogIkFCQzE + yMyIsCiAgICAgICJzZWN1cml0eVNjcmVlbmluZyI6ICJUU0EgUHJlQ2h + lY2siLAogICAgICAidW5kZXJOYW1lIjogewogICAgICAgICJAdHlwZSI + 6ICJQZXJzb24iLAogICAgICAgICJuYW1lIjogIkV2YSBHcmVlbiIKICA + gICAgfSwKICAgICAgInJlc2VydmF0aW9uRm9yIjogewogICAgICAgICJ + AdHlwZSI6ICJGbGlnaHQiLAogICAgICAgICJmbGlnaHROdW1iZXIiOiA + iVUExMTAiLAogICAgICAgICJwcm92aWRlciI6IHsKICAgICAgICAgICJ + AdHlwZSI6ICJBaXJsaW5lIiwKICAgICAgICAgICJuYW1lIjogIkNvbnR + pbmVudGFsIiwKICAgICAgICAgICJpYXRhQ29kZSI6ICJDTyIsCiAgICA + gICAgICAiYm9hcmRpbmdQb2xpY3kiOiAiaHR0cDovL3NjaGVtYS5vcmc + vWm9uZUJvYXJkaW5nUG9saWN5IgogICAgICAgIH0sCiAgICAgICAgInN + lbGxlciI6IHsKICAgICAgICAgICJAdHlwZSI6ICJBaXJsaW5lIiwKICA + gICAgICAgICJuYW1lIjogIlVuaXRlZCIsCiAgICAgICAgICAiaWF0YUN + vZGUiOiAiVUEiCiAgICAgICAgfSwKICAgICAgICAiZGVwYXJ0dXJlQWl + ycG9ydCI6IHsKICAgICAgICAgICJAdHlwZSI6ICJBaXJwb3J0IiwKICA + gICAgICAgICJuYW1lIjogIlNhbiBGcmFuY2lzY28gQWlycG9ydCIsCiA + gICAgICAgICAiaWF0YUNvZGUiOiAiU0ZPIgogICAgICAgIH0sCiAgICA + gICAgImRlcGFydHVyZVRpbWUiOiAiMjAxNy0wMy0wNFQyMDoxNTowMC0 + wODowMCIsCiAgICAgICAgImFycml2YWxBaXJwb3J0IjogewogICAgICA + gICAgIkB0eXBlIjogIkFpcnBvcnQiLAogICAgICAgICAgIm5hbWUiOiA + iSm9obiBGLiBLZW5uZWR5IEludGVybmF0aW9uYWwgQWlycG9ydCIsCiA + gICAgICAgICAiaWF0YUNvZGUiOiAiSkZLIgogICAgICAgIH0sCiAgICA + gICAgImFycml2YWxUaW1lIjogIjIwMTctMDMtMDVUMDY6MzA6MDAtMDU + 6MDAiCiAgICAgIH0KICAgIH0KICAgIDwvc2NyaXB0Pg== + +5.3. Derived + + Parameter Name: DERIVED + + Purpose: This parameter specifies that the value of the associated + property is derived from some other property value or values. + + Format Definition: This parameter is defined by the following + notation: + + derivedparam = "DERIVED" "=" ("TRUE" / "FALSE") + ; Default is FALSE + + Description: This property parameter MAY be specified on any + property when the value is derived from some other property or + properties. When present with a value of TRUE, clients MUST NOT + update the property. + + As an example, if a "STYLED-DESCRIPTION" property is present with + FMTTYPE="application/rtf", then there may be an additional + "STYLED-DESCRIPTION" property with FMTTYPE="text/html" and + DERIVED=TRUE, as well as a value created from the rtf value. + + Example: + STYLED-DESCRIPTION;FMTTYPE=text/html; + DERIVED=TRUE:... + +6. New Properties + + This specification makes use of the "NAME" property, which is defined + in [RFC7986]. + +6.1. Location Type + + Property Name: LOCATION-TYPE + + Purpose: This property specifies the type(s) of a location. + + Value Type: The value type for this property is TEXT. The allowable + values are defined below. + + Description: This property MAY be specified in "VLOCATION" + components and provides a way to differentiate multiple locations. + For example, it allows event producers to provide location + information for the venue and the parking. + + Format Definition: This property is defined by the following + notation: + + loctype = "LOCATION-TYPE" loctypeparam ":" + text *("," text) + CRLF + + loctypeparam = *(";" other-param) + + Multiple values may be used if the location has multiple purposes, + for example, a hotel and a restaurant. + + Values for this parameter are taken from the values defined in + Section 3 of [RFC4589]. New location types SHOULD be registered + in the manner laid down in Section 5 of [RFC4589]. + +6.2. Participant Type + + Property Name: PARTICIPANT-TYPE + + Purpose: This property specifies the type of participant. + + Value Type: The value type for this property is TEXT. The allowable + values are defined below. + + Property Parameters: Nonstandard parameters can be specified on this + property. + + Conformance: This property MUST be specified once within a + "PARTICIPANT" component. + + Description: This property defines the type of participation in + events or tasks. Participants can be individuals or + organizations, for example, a soccer team, the spectators, or the + musicians. + + Format Definition: This property is defined by the following + notation: + + participanttype = "PARTICIPANT-TYPE" partvalueparam ":" + partvalue CRLF + + partvalue = ("ACTIVE" + / "INACTIVE" + / "SPONSOR" + / "CONTACT" + / "BOOKING-CONTACT" + / "EMERGENCY-CONTACT" + / "PUBLICITY-CONTACT" + / "PLANNER-CONTACT" + / "PERFORMER" + / "SPEAKER" + / iana-token) ; Other IANA-registered + ; values + + partvalueparam = *(";" other-param) + + Example: The following is an example of this property. + + PARTICIPANT-TYPE:SPEAKER + + The registered values for the "PARTICIPANT-TYPE" property have the + meanings described here: + + ACTIVE: A participant taking an active role -- for example, a team + member. + + INACTIVE: A participant taking an inactive role -- for example, an + audience member. + + SPONSOR: A sponsor of the event. The "ORDER" parameter may be used + with this participant type to define the relative order of + multiple sponsors. + + CONTACT: Contact information for the event. The "ORDER" parameter + may be used with this participant type to define the relative + order of multiple contacts. + + BOOKING-CONTACT: Contact information for reservations or payment. + + EMERGENCY-CONTACT: Contact in case of emergency. + + PUBLICITY-CONTACT: Contact for publicity. + + PLANNER-CONTACT: Contact for the event planner or organizer. + + PERFORMER: A performer -- for example, the soloist or the + accompanist. The "ORDER" parameter may be used with this + participant type to define the relative order of multiple + performers. For example, ORDER=1 could define the principal + performer or soloist. + + SPEAKER: Speaker at an event. + +6.3. Resource Type + + Property Name: RESOURCE-TYPE + + Purpose: This property specifies the type of resource. + + Value Type: The value type for this property is TEXT. The allowable + values are defined below. + + Format Definition: This property is defined by the following + notation: + + restypeprop = "RESOURCE-TYPE" restypeparam ":" + restypevalue CRLF + + restypevalue = ("ROOM" + / "PROJECTOR" + / "REMOTE-CONFERENCE-AUDIO" + / "REMOTE-CONFERENCE-VIDEO" + / iana-token) ; Other IANA-registered + ; values + + restypeparam = *(";" other-param) + + Description: This property MAY be specified in "VRESOURCE" + components and provides a way to differentiate multiple resources. + + The registered values are described below. New resource types + SHOULD be registered in the manner laid down in this + specification. + + ROOM: A room for the event/meeting. + + PROJECTOR: Projection equipment. + + REMOTE-CONFERENCE-AUDIO: Audio remote conferencing facilities. + + REMOTE-CONFERENCE-VIDEO: Video remote conferencing facilities. + +6.4. Calendar Address + + Property Name: CALENDAR-ADDRESS + + Purpose: This property specifies the calendar address for a + participant. + + Value Type: CAL-ADDRESS + + Property Parameters: IANA-registered or nonstandard property + parameters can be specified on this property. + + Conformance: This property MAY be specified once within a + "PARTICIPANT" component. + + Description: This property provides a calendar user address for the + participant. If there is an "ATTENDEE" property with the same + value, then the participant is schedulable. + + Format Definition: This property is defined by the following + notation: + + calendaraddress = "CALENDAR-ADDRESS" caladdressparam ":" + cal-address CRLF + + caladdressparam = *(";" other-param) + +6.5. Styled-Description + + Property Name: STYLED-DESCRIPTION + + Purpose: This property provides for one or more rich-text + descriptions to replace that provided by the "DESCRIPTION" + property. + + Value Type: There is no default value type for this property. The + value type can be set to URI or TEXT. Other text-based value + types can be used when defined in the future. Clients MUST ignore + any properties with value types they do not understand. + + Property Parameters: IANA-registered, nonstandard, id, alternate + text representation, format type, derived, and language property + parameters can be specified on this property. + + Conformance: The property can be specified multiple times in the + "VEVENT", "VTODO", "VJOURNAL", "VFREEBUSY", "PARTICIPANT", or + "VALARM" calendar components. + + If it does appear more than once, there MUST be exactly one + instance of the property with no "DERIVED" parameter or + DERIVED=FALSE. All others MUST have DERIVED=TRUE. + + Additionally, if there is one or more "STYLED-DESCRIPTION" + property, then the "DESCRIPTION" property should either be absent + or have the parameter DERIVED=TRUE. + + Description: This property supports rich-text descriptions, for + example, HTML. Event publishers typically wish to provide more + and better-formatted information about the event. + + This property is used in the "VEVENT" and "VTODO" components to + capture lengthy textual descriptions associated with the activity. + This property is used in the "VJOURNAL" calendar component to + capture one or more textual journal entries. This property is + used in the "VALARM" calendar component to capture the display + text for a DISPLAY category of alarm and to capture the body text + for an EMAIL category of alarm. In the "PARTICIPANT" component, + it provides a detailed description of the participant. + + VALUE=TEXT is used to provide rich text inline as the property + value. + + VALUE=URI is used to provide a link to rich-text content, which is + expected to be displayed inline as part of the event. + + In either case, the "DESCRIPTION" property should be absent or + contain a plain-text rendering of the styled text. + + Applications MAY attempt to guess the media type of the resource + via inspection of its content if and only if the media type of the + resource is not given by the "FMTTYPE" parameter. If the media + type remains unknown, calendar applications SHOULD treat it as + type "text/html" and process the content as defined in + [W3C.REC-html51-20171003]. + + Multiple "STYLED-DESCRIPTION" properties may be used to provide + different formats or different language variants. However, all + but one MUST have DERIVED=TRUE. + + Format Definition: This property is defined by the following + notation: + + styleddescription = "STYLED-DESCRIPTION" styleddescparam ":" + styleddescval CRLF + + styleddescparam = *( + ; The following is REQUIRED + ; but MUST NOT occur more than once. + ; + (";" "VALUE" "=" ("URI" / "TEXT")) / + ; + ; The following are OPTIONAL + ; but MUST NOT occur more than once. + ; + (";" altrepparam) / (";" languageparam) / + (";" fmttypeparam) / (";" derivedparam) / + ; + ; The following is OPTIONAL + ; and MAY occur more than once. + ; + (";" other-param) + ) + + styleddescval = ( uri / text ) + ;Value MUST match value type + + Example: The following is an example of this property. It points to + an HTML description. + + STYLED-DESCRIPTION;VALUE=URI:http://example.org/desc001.html + +6.6. Structured-Data + + Property Name: STRUCTURED-DATA + + Purpose: This property specifies ancillary data associated with the + calendar component. + + Value Type: There is no default value type for this property. The + value type can be set to TEXT, BINARY, or URI. + + Property Parameters: IANA-registered, nonstandard, inline encoding, + and value data type property parameters can be specified on this + property. The format type and schema parameters can be specified + on this property and MUST be present for text or inline binary + encoded content information. + + Conformance: This property can be specified multiple times in an + iCalendar object. Typically, it would be used in the "VEVENT", + "VTODO", or "VJOURNAL" calendar components. + + Description: The existing properties in iCalendar cover key elements + of events and tasks, such as start time, end time, location, + summary, etc. However, different types of events often have other + specific "fields" that are useful to include in the calendar data. + For example, an event representing an airline flight could include + the airline, flight number, departure and arrival airport codes, + check-in and gate-closing times, etc. As another example, a + sporting event might contain information about the type of sport, + the home and away teams, the league the teams are in, information + about nearby parking, etc. + + This property is used to specify ancillary data in some structured + format, either directly (inline) as a "TEXT" or "BINARY" value or + as a link via a "URI" value. + + Rather than define new iCalendar properties for the variety of + event types that might occur, it would be better to leverage + existing schemas for such data. For example, schemas available at + include different event types. By using + standard schemas, interoperability can be improved between + calendar clients and noncalendaring systems that wish to generate + or process the data. + + This property allows the direct inclusion of ancillary data whose + schema is defined elsewhere. This property also includes + parameters to clearly identify the type of the schema being used + so that clients can quickly and easily spot what is relevant + within the calendar data and present that to users or process it + within the calendaring system. + + iCalendar does support an "ATTACH" property, which can be used to + include documents or links to documents within the calendar data. + However, that property does not allow data to be included as a + "TEXT" value (a feature that "STRUCTURED-DATA" does allow), plus + attachments are often treated as "opaque" data to be processed by + some other system rather than the calendar client. Thus, the + existing "ATTACH" property is not sufficient to cover the specific + needs of inclusion of schema data. Extending the "ATTACH" + property to support a new value type would likely cause + interoperability problems. Additionally, some implementations + manage attachments by stripping them out and replacing with a link + to the resource. Thus, a new property to support inclusion of + schema data is warranted. + + Format Definition: This property is defined by the following + notation: + + sdataprop = "STRUCTURED-DATA" sdataparam + ( + ";" "VALUE" "=" "TEXT" + ":" text + ) / + ( + ";" "ENCODING" "=" "BASE64" + ";" "VALUE" "=" "BINARY" + ";" binary + ) / + ( + ";" "VALUE" "=" "URI" + ":" uri + ) + CRLF + + sdataparam = *( + ; + ; The following is OPTIONAL for a URI value, + ; REQUIRED for a TEXT or BINARY value, + ; and MUST NOT occur more than once. + ; + (";" fmttypeparam) / + (";" schemaparam) / + ; + ; The following is OPTIONAL + ; and MAY occur more than once. + ; + (";" other-param) + ; + ) + + Example: The following is an example of this property. + + STRUCTURED-DATA;FMTTYPE=application/ld+json; + SCHEMA="https://schema.org/SportsEvent"; + VALUE=TEXT:{\n + "@context": "http://schema.org"\,\n + "@type": "SportsEvent"\,\n + "homeTeam": "Pittsburgh Pirates"\,\n + "awayTeam": "San Francisco Giants"\n + }\n + +7. New Components + +7.1. Participant + + Component name: PARTICIPANT + + Purpose: This component provides information about a participant in + an event or task. + + Conformance: This component can be specified multiple times in a + "VEVENT", "VTODO", "VJOURNAL", or "VFREEBUSY" calendar component. + + Description: This component provides information about a participant + in a calendar component. A participant may be an attendee in a + scheduling sense, and the "ATTENDEE" property may be specified in + addition. Participants can be individuals or organizations, for + example, a soccer team, the spectators, or the musicians. + + "STRUCTURED-DATA" properties, if present, may refer to definitions + of the participant -- such as a vCard. + + The "CALENDAR-ADDRESS" property, if present, will provide a cal- + address. If an "ATTENDEE" property has the same value, the + participant is considered schedulable. The "PARTICIPANT" + component can be used to contain additional metadata related to + the attendee. + + Format Definition: This component is defined by the following + notation: + + participantc = "BEGIN" ":" "PARTICIPANT" CRLF + partprop *locationc *resourcec + "END" ":" "PARTICIPANT" CRLF + + partprop = *( + ; + ; The following are REQUIRED + ; but MUST NOT occur more than once. + ; + participanttype / uid / + ; + ; The following are OPTIONAL + ; but MUST NOT occur more than once. + ; + calendaraddress / created / description / dtstamp / + geo / last-mod / priority / seq / + status / summary / url / + ; + ; The following are OPTIONAL + ; and MAY occur more than once. + ; + attach / categories / comment + contact / location / rstatus / related / + resources / strucloc / strucres / + styleddescription / sdataprop / iana-prop + ; + ) + + Note: When the "PRIORITY" property is supplied, it defines the + ordering of "PARTICIPANT" components with the same value for the + "PARTICIPANT-TYPE" property. + + Privacy Issues: When a "LOCATION" property is supplied, it provides + information about the location of a participant at a given time or + times. This may represent an unacceptable privacy risk for some + participants. User agents MUST NOT broadcast this information + without the express permission of the participants whose location + would be exposed. For further comments, see Section 10. + + Example: The following is an example of this component. It contains + a "STRUCTURED-DATA" property that points to a vCard providing + information about the event participant. + + BEGIN:PARTICIPANT + UID: em9lQGZvb2GFtcGxlLmNvbQ + PARTICIPANT-TYPE:PERFORMER + STRUCTURED-DATA;VALUE=URI: + http://dir.example.com/vcard/aviolinist.vcf + END:PARTICIPANT + + Example: The following is an example for the primary contact. + + BEGIN:PARTICIPANT + UID: em9lQGZvb2GFtcGxlLmNvbQ + STRUCTURED-DATA;VALUE=URI; + http://dir.example.com/vcard/contacts/contact1.vcf + PARTICIPANT-TYPE:CONTACT + DESCRIPTION:A contact + END:PARTICIPANT + + Example: The following is an example for a participant with contact + and location. + + BEGIN:PARTICIPANT + UID: em9lQGZvb2GFtcGxlLmNdrt + STRUCTURED-DATA;VALUE=URI; + http://dir.example.com/vcard/contacts/my-card.vcf + PARTICIPANT-TYPE:SPEAKER + DESCRIPTION:A participant + BEGIN:VLOCATION + UID:123456-abcdef-98765432 + NAME:My home location + STRUCTURED-DATA;VALUE=URI: + http://dir.example.com/addresses/my-home.vcf + END:VLOCATION + END:PARTICIPANT + +7.1.1. Schedulable Participant + + A "PARTICIPANT" component may represent someone or something that + needs to be scheduled, as defined for ATTENDEE in [RFC5545] and + [RFC5546]. The "PARTICIPANT" component may also represent someone or + something that is NOT to receive scheduling messages. + + For backwards compatibility with existing clients and servers when + used to schedule events and tasks, the "ATTENDEE" property MUST be + used to specify the scheduling parameters as defined for that + property. + + For other, future uses, the "CALENDAR-ADDRESS" property MUST be used + to specify those parameters. + + A "PARTICIPANT" component is defined to be schedulable if: + + * it contains a "CALENDAR-ADDRESS" property and + + * that property value is the same as the value for an "ATTENDEE" + property. + + If both of these conditions apply, then the participant defined by + the value of the URL property will take part in scheduling + operations, as defined in [RFC5546]. + + An appropriate use for the "PARTICIPANT" component in scheduling + would be to store "SEQUENCE" and "DTSTAMP" properties associated with + replies from each "ATTENDEE" property. A "LOCATION" property within + the "PARTICIPANT" component might allow better selection of meeting + times when participants are in different time zones. + +7.2. Location + + Component name: VLOCATION + + Purpose: This component provides rich information about the location + of an event using the structured data property or, optionally, a + plain-text typed value. + + Conformance: This component can be specified multiple times in a + "VEVENT", "VTODO", "VJOURNAL", "VFREEBUSY", or "PARTICIPANT" + calendar component. + + Description: There may be a number of locations associated with an + event. This component provides detailed information about a + location. + + When used in a component, the value of this property provides + information about the event venue or of related services, such as + parking, dining, stations, etc. + + "STRUCTURED-DATA" properties, if present, may refer to + representations of the location -- such as a vCard. + + Format Definition: This component is defined by the following + notation: + + locationc = "BEGIN" ":" "VLOCATION" CRLF + locprop + "END" ":" "VLOCATION" CRLF + + locprop = *( + ; + ; The following are REQUIRED + ; but MUST NOT occur more than once. + ; + uid / + ; + ; The following are OPTIONAL + ; but MUST NOT occur more than once. + ; + description / geo / loctype / name + ; + ; The following are OPTIONAL + ; and MAY occur more than once. + ; + sdataprop / iana-prop + ) + + The "NAME" property is defined in [RFC7986]. + + Example: The following is an example of this component. It points + to a venue. + + BEGIN:VLOCATION + UID:123456-abcdef-98765432 + NAME:The venue + STRUCTURED-DATA;VALUE=URI: + http://dir.example.com/venues/big-hall.vcf + END:VLOCATION + +7.3. Resource + + Component name: VRESOURCE + + Purpose: This component provides a typed reference to external + information about a resource or, optionally, a plain-text typed + value. Typically, a resource is anything that might be required + or used by a calendar entity and possibly has a directory entry. + + Conformance: This component can be specified multiple times in a + "VEVENT", "VTODO", "VJOURNAL", "VFREEBUSY", or "PARTICIPANT" + calendar component. + + Description: When used in a component, this component provides + information about resources used for the event, such as rooms, + projectors, and conferencing capabilities. + + The RESOURCE-TYPE value registry provides a place in which + resource types may be registered. + + "STRUCTURED-DATA" properties, if present, may refer to + representations of the resource -- such as a vCard. + + Format Definition: This component is defined by the following + notation: + + resourcec = "BEGIN" ":" "VRESOURCE" CRLF + resprop + "END" ":" "VRESOURCE" CRLF + + resprop = *( + ; + ; The following are REQUIRED + ; but MUST NOT occur more than once. + ; + uid / + ; + ; The following are OPTIONAL + ; but MUST NOT occur more than once. + ; + description / geo / name / restype / + ; + ; The following are OPTIONAL + ; and MAY occur more than once. + ; + sdataprop / iana-prop + ) + + The "NAME" property is defined in [RFC7986]. + + Example: The following is an example of this component. It refers + to a projector. + + BEGIN:VRESOURCE + UID:456789-abcdef-98765432 + NAME:The projector + RESOURCE-TYPE:projector + STRUCTURED-DATA;VALUE=URI:http://dir.example.com/projectors/3d.vcf + END:VRESOURCE + +8. Extended Examples + + The following are some examples of the use of the properties defined + in this specification. They include additional properties defined in + [RFC7986], which includes "IMAGE". + +8.1. Example 1 + + The following is an example of a "VEVENT" describing a concert. It + includes location information for the venue itself, as well as + references to parking and restaurants. + + BEGIN:VEVENT + CREATED:20200215T145739Z + DESCRIPTION: Piano Sonata No 3\n + Piano Sonata No 30 + DTSTAMP:20200215T145739Z + DTSTART;TZID=America/New_York:20200315T150000Z + DTEND;TZID=America/New_York:20200315T163000Z + LAST-MODIFIED:20200216T145739Z + SUMMARY:Beethoven Piano Sonatas + UID:123456 + IMAGE;VALUE=URI;DISPLAY=BADGE;FMTTYPE=image/png:h + ttp://example.com/images/concert.png + BEGIN:PARTICIPANT + PARTICIPANT-TYPE:SPONSOR + UID:dG9tQGZvb2Jhci5xlLmNvbQ + STRUCTURED-DATA;VALUE=URI:http://example.com/sponsor.vcf + END:PARTICIPANT + BEGIN:PARTICIPANT + PARTICIPANT-TYPE:PERFORMER: + UID:em9lQGZvb2GFtcGxlLmNvbQ + STRUCTURED-DATA;VALUE=URI:http://www.example.com/people/johndoe.vcf + END:PARTICIPANT + BEGIN:VLOCATION + UID:123456-abcdef-98765432 + NAME:The venue + STRUCTURED-DATA;VALUE=URI:http://dir.example.com/venues/big-hall.vcf + END:VLOCATION + BEGIN:VLOCATION + UID:123456-abcdef-87654321 + NAME:Parking for the venue + STRUCTURED-DATA;VALUE=URI:http://dir.example.com/venues/parking.vcf + END:VLOCATION + END:VEVENT + +8.2. Example 2 + + The following is an example of a "VEVENT" describing a meeting. One + of the attendees is a remote participant. + + BEGIN:VEVENT + CREATED:20200215T145739Z + DTSTAMP:20200215T145739Z + DTSTART;TZID=America/New_York:20200315T150000Z + DTEND;TZID=America/New_York:20200315T163000Z + LAST-MODIFIED:20200216T145739Z + SUMMARY:Conference planning + UID:123456 + ORGANIZER:mailto:a@example.com + ATTENDEE;PARTSTAT=ACCEPTED;CN=A:mailto:a@example.com + ATTENDEE;RSVP=TRUE;CN=B:mailto:b@example.com + BEGIN:PARTICIPANT + PARTICIPANT-TYPE:ACTIVE: + UID:v39lQGZvb2GFtcGxlLmNvbQ + STRUCTURED-DATA;VALUE=URI:http://www.example.com/people/b.vcf + LOCATION:At home + END:PARTICIPANT + END:VEVENT + +9. Security Considerations + + This specification extends [RFC5545] and makes further use of + possibly linked data. While calendar data is not unique in this + regard, it is worth reminding implementors of some of the dangers and + safeguards. + +9.1. URIs + + See [RFC3986] for a discussion of the security considerations + relating to URIs. Because of the issues discussed there and below, + clients SHOULD NOT follow URIs and fetch content automatically and + should only do so at the explicit request of the user. + + Fetching remote resources carries inherent risks. Connections must + only be allowed on well-known ports, using allowed protocols + (generally just HTTP/HTTPS on their default ports). The URL must be + resolved externally and not allowed to access internal resources. + Connecting to an external source reveals IP (and therefore generally + location) information. + + A maliciously constructed iCalendar object may contain a very large + number of URIs. In the case of published calendars with a large + number of subscribers, such objects could be widely distributed. + Implementations should be careful to limit the automatic fetching of + linked resources to reduce the risk of this being an amplification + vector for a denial-of-service attack. + +9.2. Malicious Content + + For the "STRUCTURED-DATA" property, agents need to be aware that a + client could attack underlying storage by sending extremely large + values and could attack processing time by uploading a recurring + event with a large number of overrides and then repeatedly adding, + updating, and deleting structured data. + + Agents should set reasonable limits on storage size and number of + instances and apply those constraints. Calendar protocols should + ensure there is a way to report on such limits being exceeded. + + Malicious content could be introduced into the calendar server by way + of the "STRUCTURED-DATA" property and propagated to many end users + via scheduling. Servers SHOULD check this property for malicious or + inappropriate content. Upon detecting such content, servers SHOULD + remove the property. + +9.3. HTML Content + + When processing HTML content, applications need to be aware of the + many security and privacy issues, as described in the IANA + Considerations section of [W3C.REC-html51-20171003]. + +10. Privacy Considerations + +10.1. Tracking + + Properties with a "URI" value type can expose their users to privacy + leaks, as any network access of the URI data can be tracked both by a + network observer and by the entity hosting the remote resource. + Clients SHOULD NOT automatically download data referenced by the URI + without explicit instruction from users. + + To help alleviate some of the concerns, protocols and services could + provide proxy services for downloading referenced data. + +10.2. Revealing Locations + + The addition of location information to the new participant component + provides information about the location of participants at a given + time. This information MUST NOT be distributed to other participants + without those participant's express permission. Note that there may + be a number of participants who may be unaware of their inclusion in + the data. + + Agents processing and distributing calendar data must be aware that + it has the property of providing information about a future time when + a given individual may be at a particular location, which could + enable targeted attacks against that individual. + + The same may be true of other information contained in the + participant component. In general, revealing only as much as is + absolutely necessary should be the approach taken. + + For example, there may be some privacy considerations relating to the + "ORDER" parameter, as it provides an indication of the organizer's + perception of the relative importance of other participants. + +11. IANA Considerations + +11.1. Additional iCalendar Registrations + +11.1.1. Properties + + This document defines the following iCalendar properties that have + been added to the "Properties" registry defined in Section 8.2.3 of + [RFC5545]: + + +====================+=========+=======================+ + | Property | Status | Reference | + +====================+=========+=======================+ + | CALENDAR-ADDRESS | Current | RFC 9073, Section 6.4 | + +--------------------+---------+-----------------------+ + | LOCATION-TYPE | Current | RFC 9073, Section 6.1 | + +--------------------+---------+-----------------------+ + | PARTICIPANT-TYPE | Current | RFC 9073, Section 6.2 | + +--------------------+---------+-----------------------+ + | RESOURCE-TYPE | Current | RFC 9073, Section 6.3 | + +--------------------+---------+-----------------------+ + | STRUCTURED-DATA | Current | RFC 9073, Section 6.6 | + +--------------------+---------+-----------------------+ + | STYLED-DESCRIPTION | Current | RFC 9073, Section 6.5 | + +--------------------+---------+-----------------------+ + + Table 1: Additions to the Properties Registry + +11.1.2. Parameters + + This document defines the following iCalendar property parameters + that have been added to the "Parameters" registry defined in + Section 8.2.4 of [RFC5545]: + + +===========+=========+=======================+ + | Parameter | Status | Reference | + +===========+=========+=======================+ + | ORDER | Current | RFC 9073, Section 5.1 | + +-----------+---------+-----------------------+ + | SCHEMA | Current | RFC 9073, Section 5.2 | + +-----------+---------+-----------------------+ + | DERIVED | Current | RFC 9073, Section 5.3 | + +-----------+---------+-----------------------+ + + Table 2: Additions to the Parameters Registry + +11.1.3. Components + + This document defines the following iCalendar components that have + been added to the "Components" registry defined in Section 8.3.1 of + [RFC5545]: + + +=============+=========+=======================+ + | Component | Status | Reference | + +=============+=========+=======================+ + | PARTICIPANT | Current | RFC 9073, Section 7.1 | + +-------------+---------+-----------------------+ + | VLOCATION | Current | RFC 9073, Section 7.2 | + +-------------+---------+-----------------------+ + | VRESOURCE | Current | RFC 9073, Section 7.3 | + +-------------+---------+-----------------------+ + + Table 3: Additions to the Components Registry + +11.2. Participant Types and Resource Types Registries + + This section defines new registration tables for PARTICIPANT-TYPE and + RESOURCE-TYPE values. These tables are updated using the same + approaches laid down in Section 8.2.1 of [RFC5545]. + + This document creates new IANA registries for participant and + resource types. IANA will maintain these registries and, following + the policies outlined in [RFC8126], new tokens are assigned after + Expert Review. The Expert Reviewer will generally consult the IETF + GEOPRIV Working Group mailing list or its designated successor. + Updates or deletions of tokens from the registration follow the same + procedures. The Expert Review should be guided by a few common-sense + considerations. For example, tokens should not be specific to a + country, region, organization, or company; they should be well + defined and widely recognized. The Expert's support of IANA will + include providing IANA with the new token(s) when the update is + provided only in the form of a schema and providing IANA with the new + schema element(s) when the update is provided only in the form of a + token. To ensure widespread usability across protocols, tokens MUST + follow the character set restrictions for XML Names + [W3C.REC-xml-20040204]. Each registration must include the name of + the token and a brief description similar to the ones offered herein + for the initial registrations contained this document. + +11.2.1. Participant Types + + +===================+=========+=======================+ + | Participant Type | Status | Reference | + +===================+=========+=======================+ + | ACTIVE | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | INACTIVE | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | SPONSOR | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | CONTACT | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | BOOKING-CONTACT | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | EMERGENCY-CONTACT | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | PUBLICITY-CONTACT | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | PLANNER-CONTACT | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | PERFORMER | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + | SPEAKER | Current | RFC 9073, Section 6.2 | + +-------------------+---------+-----------------------+ + + Table 4: Initial Contents of the Participant Types + Registry + +11.2.2. Resource Types + + +=========================+=========+=======================+ + | Resource Type | Status | Reference | + +=========================+=========+=======================+ + | PROJECTOR | Current | RFC 9073, Section 6.3 | + +-------------------------+---------+-----------------------+ + | ROOM | Current | RFC 9073, Section 6.3 | + +-------------------------+---------+-----------------------+ + | REMOTE-CONFERENCE-AUDIO | Current | RFC 9073, Section 6.3 | + +-------------------------+---------+-----------------------+ + | REMOTE-CONFERENCE-VIDEO | Current | RFC 9073, Section 6.3 | + +-------------------------+---------+-----------------------+ + + Table 5: Initial Contents of the Resource Types Registry + +12. Normative References + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119, + DOI 10.17487/RFC2119, March 1997, + . + + [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform + Resource Identifier (URI): Generic Syntax", STD 66, + RFC 3986, DOI 10.17487/RFC3986, January 2005, + . + + [RFC4589] Schulzrinne, H. and H. Tschofenig, "Location Types + Registry", RFC 4589, DOI 10.17487/RFC4589, July 2006, + . + + [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax + Specifications: ABNF", STD 68, RFC 5234, + DOI 10.17487/RFC5234, January 2008, + . + + [RFC5545] Desruisseaux, B., Ed., "Internet Calendaring and + Scheduling Core Object Specification (iCalendar)", + RFC 5545, DOI 10.17487/RFC5545, September 2009, + . + + [RFC5546] Daboo, C., Ed., "iCalendar Transport-Independent + Interoperability Protocol (iTIP)", RFC 5546, + DOI 10.17487/RFC5546, December 2009, + . + + [RFC6350] Perreault, S., "vCard Format Specification", RFC 6350, + DOI 10.17487/RFC6350, August 2011, + . + + [RFC7986] Daboo, C., "New Properties for iCalendar", RFC 7986, + DOI 10.17487/RFC7986, October 2016, + . + + [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for + Writing an IANA Considerations Section in RFCs", BCP 26, + RFC 8126, DOI 10.17487/RFC8126, June 2017, + . + + [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC + 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, + May 2017, . + + [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data + Interchange Format", STD 90, RFC 8259, + DOI 10.17487/RFC8259, December 2017, + . + + [W3C.REC-html51-20171003] + Faulkner, S., Ed., Eicholz, A., Ed., Leithead, T., Ed., + and A. Danilo, Ed., "HTML 5.1 2nd Edition", World Wide Web + Consortium Recommendation REC-html51-20171003, October + 2017, . + + [W3C.REC-xml-20040204] + Sperberg-McQueen, M., Maler, E., Bray, T., Paoli, J., and + F. Yergeau, "Extensible Markup Language (XML) 1.0 (Third + Edition)", World Wide Web Consortium Recommendation REC- + xml-20040204, February 2004, + . + + [W3C.REC-xml-20081126] + Bray, T., Ed., Paoli, J., Ed., Sperberg-McQueen, M., Ed., + Maler, E., Ed., and F. Yergeau, Ed., "Extensible Markup + Language (XML) 1.0 (Fifth Edition)", World Wide Web + Consortium Recommendation REC-xml-20081126, November 2008, + . + +Acknowledgements + + The author would like to thank Chuck Norris of eventful.com for his + work, which led to the development of this RFC. + + The author would also like to thank the members of CalConnect: The + Calendaring and Scheduling Consortium, the Event Publication + technical committee, and the following individuals for contributing + their ideas and support: + + Cyrus Daboo, John Haug, Dan Mendell, Ken Murchison, and Scott Otis. + +Author's Address + + Michael Douglass + Bedework + 226 3rd Street + Troy, NY 12180 + United States of America + + Email: mdouglass@bedework.com + URI: http://bedework.com