NAME

Markdown::Parser::Scope - Markdown Parser Scope Object Class

SYNOPSIS

    my $scope = Markdown::Parser::Scope->new( [qw( all extended )] );
    if( $scope->has( 'paragraph' ) )
    {
        # then do something
    }

VERSION

    v0.1.0

DESCRIPTION

This is the Scope object class used by the parser Markdown::Parser to determine what to parse and what to skip. It inherits from Module::Generic

METHODS

all

Sets or gets the property to all.

as_string

Returns a string representation of the scope.

condition

Sets or gets the condition when checking for scope. Valid value is either any or all. By default, it is set to any. For example:

If condition is set to any, then this:

    [qw( code extended )]

means that it would match any markdown formatting that are either a code or an extended formatting. But if the condition is set to all instead, then the same value will have the scope apply only to extended version of code formatting.

extended

Sets or gets whether the scope includes extended markdown attributes, ie. any other formatting that is not part of the standard markdown.

extended_only

Sets or gets whether the scope applies only to extended markdown formattings.

has

Provided with a scope check and this will check whether it is in scope or not based on the parameters set for this scope object.

scope

Sets or gets the scope object, which is a Module::Generic::Hash object.

PRIVATE METHOD

_set_get_prop

Given a property name, and optional value, and this will set or get this value for this property in the "scope" hash object.

SEE ALSO

Markdown original author reference on emphasis: https://daringfireball.net/projects/markdown/syntax#em

AUTHOR

Jacques Deguest <jack@deguest.jp>

COPYRIGHT & LICENSE

Copyright (c) 2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.