GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — page: /tags/excerpt · Issue #211 · textpattern/textpattern.github.io

page: /tags/excerpt #211

New issue
Copy link
New issue
Copy link
Open
Open
page: /tags/excerpt#211
Copy link

Description

@butterp1
butterp1
opened on Jan 29, 2024
Issue body actions

URLs

  • Back: {repo URL here (.md file)}
  • Front: {website URL here}

Explanation of immediate task

The trim regex given as an example to trim body for excerpt seems to trip up if textile is enable in the body field (prepending the truncated text with p>), no matter what the escape attributes. I have better luck with <txp:body escape="tags" trim="/^(<[^>]*>)*((?:\w+\W+){35})\w.*$/s" replace="$2&hellip;" />, which excludes initial tags.

Resources to support effort

  • https://regex101.com/r/XBYWrs/1

Current to-dos

  • Maybe update example with note for textile users

Activity

  1. bloatware commented on Jan 29, 2024

    @bloatware
    bloatware
    on Jan 29, 2024
    Member
    More actions

    Thank you for the report, but I'm not sure textile interferes here. Could you provide more details re the article body content?

  2. butterp1 commented on Jan 30, 2024

    @butterp1
    butterp1
    on Jan 30, 2024
    SponsorAuthor
    More actions

    Hi,
    I've just reinstated the trim regex from the TXP docs and made a test article using a couple of paragraphs of plain text. Screenshots attached of front and back end, firstly with Textile on then with it off.

    I've only seen this happen on a couple of older sites, so may be something in the config or hosting conditions or a plugin.

    I've tried the regex on the regex101 site and it removes the opening bracket from an opening p tag, so I'm guessing the regex trim happens before the transform / escape?

    LEAVE TEXT UNTOUCHED
    Screen Shot 2024-01-31 at 9 59 48 am

    TEXTILE
    Screen Shot 2024-01-31 at 9 58 33 am

  3. bloatware commented on Jan 31, 2024

    @bloatware
    bloatware
    on Jan 31, 2024
    Member
    More actions

    Thank you. Have you also set escape="tags" attribute before trim? Unless php strip_tags() function is somehow disabled on your server (see diagnostics), it should have removed all html tags prior to trimming.

    This said, the example regex might be a bit loose, indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.