Skip to content

Parsing BBCode to List #17

Description

@erayerdin

I didn't see it in documentation, so I thought maybe this feature does not exist.

Is there a way to parse bbcode to a list from a string? Considering a custom tag as a:

text = "Lorem ipsum dolor sit amet, [a]consectetur[/a] adipiscing elit, sed do eiusmod [a]tempor[/a] incididunt ut labore [a]et[/a] dolore magna aliqua."

parser("a", "text")
["consectetur","tempor","et"]

Why do I need it? (Or why would someone else need it?)

In a basic blog, where titles are (for an unknown reason) implemented as a different model (not a field) called as Title.

I want to get value of a tag and filter a QuerySet based on that value. Considering the former example:

Title.objects.filter(label="consectetur")

Is it possible yet?

Thanks in advance.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions