Skip to content

[Question/Feature Request]Why it is intended to not strip ending "t.co" link in text content if it contains line terminators? #303

@rizutazu

Description

@rizutazu

For example, https://x.com/XHandles/status/1979714051665260601 . In twitter it is displayed as:

Handles are coming...

Join the waitlist at http://handles.x.com/

api.vxtwitter.com returns:

"text": "Handles are coming...\n\nJoin the waitlist at http://handles.x.com https://t.co/XOa9b2lfkN",

the ending "t.co" link https://t.co/XOa9b2lfkN is not stripped.

At https://github.com/dylanpdx/BetterTwitFix/blob/main/utils.py#L6

endTCOregex = re.compile("(^.*?) +https:\/\/t.co\/.*?$")

. matches any character (except for line terminators) (quoted from regex101)

By "intended to not strip", I mean some test cases in https://github.com/dylanpdx/BetterTwitFix/blob/main/vx_testdata.py explicitly preserved ending "t.co" link.

I hope these links to be removed as if there were no line terminators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions