Skip to content

Commit

Permalink
Clarify usage of src attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Nov 16, 2024
1 parent 25097a7 commit 2b3ed55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Remove ambiguous statements about escaping from documentation. [`#85`](https://github.com/rust-syndication/atom/pull/85)
- Update `quick-xml` to `0.37`. [`#86`](https://github.com/rust-syndication/atom/pull/86)
- Clarify usage of `src` attribute of a `Content` structure. [`#87`](https://github.com/rust-syndication/atom/pull/87)

## 0.12.4 - 2024-08-28

Expand Down
11 changes: 11 additions & 0 deletions src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ use crate::toxml::ToXml;
use crate::util::{atom_text, atom_xhtml, attr_value, decode};

/// Represents the content of an Atom entry
//
/// ## Attention
///
/// Atom format specification [RFC4287](https://datatracker.ietf.org/doc/html/rfc4287#section-4.1.3.2)
/// states that `src` and `value` (content) fields are mutually exclusive:
///
/// > atom:content MAY have a "src" attribute, whose value MUST be an IRI reference.
/// > If the "src" attribute is present, atom:content MUST be empty.
///
/// Setting of both fields when authoring an Atom feed is still technically possible,
/// but it will lead to a non-compliant result.
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Debug, Default, Clone, PartialEq)]
#[cfg_attr(feature = "builders", derive(Builder))]
Expand Down

0 comments on commit 2b3ed55

Please sign in to comment.