Revision 36ecffa0
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
modules/override/Text/MultiMarkdown.pm | ||
---|---|---|
1067 | 1067 |
|
1068 | 1068 |
my $alignment_string = $1; |
1069 | 1069 |
my $body = $2; |
1070 |
my $colgroup = ''; |
|
1070 | 1071 |
|
1071 | 1072 |
# Process column alignment |
1072 | 1073 |
while ($alignment_string =~ /\|?\s*(.+?)\s*(\||\Z)/gs) { |
1073 | 1074 |
my $cell = $self->_RunSpanGamut($1); |
1074 | 1075 |
if ($cell =~ /\:$/) { |
1075 | 1076 |
if ($cell =~ /^\:/) { |
1076 |
$result .= qq[<col align="center"$self->{empty_element_suffix}\n];
|
|
1077 |
$colgroup .= qq[<col align="center"$self->{empty_element_suffix}\n];
|
|
1077 | 1078 |
push(@alignments,"center"); |
1078 | 1079 |
} |
1079 | 1080 |
else { |
1080 |
$result .= qq[<col align="right"$self->{empty_element_suffix}\n];
|
|
1081 |
$colgroup .= qq[<col align="right"$self->{empty_element_suffix}\n];
|
|
1081 | 1082 |
push(@alignments,"right"); |
1082 | 1083 |
} |
1083 | 1084 |
} |
1084 | 1085 |
else { |
1085 | 1086 |
if ($cell =~ /^\:/) { |
1086 |
$result .= qq[<col align="left"$self->{empty_element_suffix}\n];
|
|
1087 |
$colgroup .= qq[<col align="left"$self->{empty_element_suffix}\n];
|
|
1087 | 1088 |
push(@alignments,"left"); |
1088 | 1089 |
} |
1089 | 1090 |
else { |
1090 | 1091 |
if (($cell =~ /^\./) || ($cell =~ /\.$/)) { |
1091 |
$result .= qq[<col align="char"$self->{empty_element_suffix}\n];
|
|
1092 |
$colgroup .= qq[<col align="char"$self->{empty_element_suffix}\n];
|
|
1092 | 1093 |
push(@alignments,"char"); |
1093 | 1094 |
} |
1094 | 1095 |
else { |
1095 |
$result .= "<col$self->{empty_element_suffix}\n";
|
|
1096 |
$colgroup .= "<col$self->{empty_element_suffix}\n";
|
|
1096 | 1097 |
push(@alignments,""); |
1097 | 1098 |
} |
1098 | 1099 |
} |
1099 | 1100 |
} |
1100 | 1101 |
} |
1101 | 1102 |
|
1103 |
if ($colgroup) { |
|
1104 |
$result .= qq|<colgroup$self->{empty_element_suffix}\n| |
|
1105 |
. $colgroup |
|
1106 |
. qq|</colgroup$self->{empty_element_suffix}\n|; |
|
1107 |
} |
|
1108 |
|
|
1102 | 1109 |
# Process headers |
1103 | 1110 |
$table =~ s/^\n+//s; |
1104 | 1111 |
|
Auch abrufbar als: Unified diff
MultiMarkdown: <col>-Attribute in eine <colgroup> einbetten