Skip to content

Minor bug on how post body carriage returns are handled #16

@halfer

Description

@halfer

In chapter 3 there is this intro:

Next, let us add in some logic that interprets two carriage-returns in a post as a paragraph break. Here we go:

The code to do that is given as:

$paraText = str_replace("\n", "</p><p>", $bodyText);

That just replaces a single CR, not a double. To fix this, I could change either the code or the text. If I change the code to \n\n then a single CR will be ignored - which is probably OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions