Skip to content

Ideas #16

@thunderer

Description

@thunderer

Just a list of issues to remember:

  • custom exceptions for specific cases rather than using generic ones,
  • recipes for specific tasks (like find all shortcode names in text),
  • upgrade RegularParser to not split text into tokens at once but iterate over characters,
  • shortcodes with children to represent their structure in text,
  • shortcode's getTextUntilNext() which returns the content up to the next shortcode opening tag,
  • shortcode name wildcard,
  • more complex positional parameters [x=http://x.com], [x x=http://x.com],
  • shortcode escaping by doubling opening / closing token [[x /]], [[y a=b]],
  • tools for text analysis (nesting depth, count, name stats, etc.)
  • configurable shortcode name validation rules,
  • solve BBCode ambiguity issues in [x=] and [x= arg=val],
  • add ProcessedShortcodeInterface and Processor::withShortcodeFactory() (think of a better name) to allow creating custom shortcode objects using ProcessorContext that are compatible with ProcessedShortcode. This will allow users to put their information inside while still maintaining how library works,
  • fix inconsistency between getText and getShortcodeText between ParsedShortcode and ProcessedShortcode,
  • make ShortcodeFacade a mutable class with all the shortcuts to ease library usage (Improved facade #36),
  • new regex parser that catches only opening/closing tags and handles nesting manually,
  • repeated shortcodes, ie. ability to repeat inner content with collections of data, [list]- [item/],[/list] which renders multiple "item" elements, children of list (item shortcodes) receive context from data passed to list,
  • better documentation than it is now in README (Improved README #34),
  • extract several event listener classes with __invoke() to ease events usage (Builtin handlers #33),
  • find a way to strip content outside shortcodes in given shortcode content without losing tree structure (apply results event),
  • configurable handler for producing Processor::process() return value using array of replacements (events FTW),
  • issue with losing shortcode parent when many same shortcodes are on the same level,
  • HUGE BC (just an idea, no worries): Change ProcessorInterface::process() to receive array of parsed shortcodes to allow greater flexibility (eg. filtering by parent),
  • find a way to retrieve original shortcode content even when auto-processing,
  • prevent the ability to create shortcode with falsy name (require non-empty string value),
  • resolve naming problem for shortcode parameters (current) vs. arguments,
  • suggest symfony/yaml in composer.json for YAML serializer,
  • allow escaping with double open/close tags like in WordPress ([[code]value[/code]]),
  • add Wordpress parser (regex parser with code from WP).

Regular parser:

  • fix BBCode parsing (unused variable).

BBCode:

  • decide whether bbcode value should be:
    • merged with parameters as parameter with shortcode name, no API change, easier version,
    • a separate element, fourth parameter in Shortcode constructor, and separate getter,
    • a separate shortcode type (requires changes in both Parsed and Processed as well).

Built-in handlers:

  • DeclareHandler should typehint interface in constructor, (needs add() method)
  • EmailHandler could be a BBCode,
  • PlaceholderHandler should have configurable placeholder braces,
  • UrlHandler could be a BBCode,
  • WrapHandler could have several most common variants (eg. bold) created as named constructors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions