| 1 | # This code is part of Perl distribution OODoc version 3.05. | ||
| 2 | # The POD got stripped from this file by OODoc version 3.05. | ||
| 3 | # For contributors see file ChangeLog. | ||
| 4 | |||
| 5 | # This software is copyright (c) 2003-2025 by Mark Overmeer. | ||
| 6 | |||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||
| 10 | |||
| 11 | |||
| 12 | package OODoc::Format::TemplateMagic;{ | ||
| 13 | our $VERSION = '3.05'; | ||
| 14 | } | ||
| 15 | |||
| 16 | |||
| 17 | use strict; | ||
| 18 | use warnings; | ||
| 19 | |||
| 20 | use Log::Report 'oodoc'; | ||
| 21 | use Scalar::Util qw/blessed/; | ||
| 22 | |||
| 23 | #-------------------- | ||
| 24 | |||
| 25 | sub zoneGetParameters($) | ||
| 26 | { my ($self, $zone) = @_; | ||
| 27 | my $param = blessed $zone ? $zone->attributes : $zone; | ||
| 28 | $param =~ s/^\s+//; | ||
| 29 | $param =~ s/\s+$//; | ||
| 30 | length $param or return (); | ||
| 31 | |||
| 32 | $param =~ m/[^\s\w]/ | ||
| 33 | or return split " ", $param; # old style | ||
| 34 | |||
| 35 | # new style | ||
| 36 | my @params = split /\s*\,\s*/, $param; | ||
| 37 | map split(/\s*\=\>\s*/, $_, 2), @params; | ||
| 38 | } | ||
| 39 | |||
| 40 | 1; |