add 'Else' to the last line of the algorithm · Issue #18 · tantek/post-type-discovery (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@PaulJeong14

Description

@PaulJeong14

I think 'Else' should be added to the last line of the section 3 algorithm

If the post has no "name" property
or has a "name" property with an empty string value (or no value)
Then it is a note post.
Take the first non-empty value of the "name" property
Trim all leading/trailing whitespace
Collapse all sequences of internal whitespace to a single space (0x20) character each
Do the same with the content
If this processed "name" property value is NOT a prefix of the processed content,
Then it is an article post.
[Else] It is a note post.