Compare commits

...
Sign in to create a new pull request.

16 commits

Author SHA1 Message Date
Fedora Release Engineering
419b89b2ab Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 05:14:34 +00:00
Tim Landscheidt
54288f43bc Remove outdated information from package description 2025-03-23 05:07:54 +00:00
Fedora Release Engineering
f5d1ea3160 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 09:08:53 +00:00
Fedora Release Engineering
593fdc3ba3 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 06:58:00 +00:00
Fedora Release Engineering
50c08d9afe Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 22:43:44 +00:00
Fedora Release Engineering
86d1ce7914 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 20:57:00 +00:00
Sérgio M. Basto
17db8577b0 Update php-markdown to 2.0.0 2023-10-06 15:07:23 +01:00
621f167e8a Unretirement request: https://pagure.io/releng/issue/11710 2023-10-06 10:24:36 +02:00
Remi Collet
5bf2a74d68 FTBFS 2023-09-29 08:31:41 +02:00
Fedora Release Engineering
37912e83ef Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 04:26:34 +00:00
Gwyn Ciesla
e48598fa70 migrated to SPDX license 2023-03-01 14:13:12 -06:00
Fedora Release Engineering
05d0e405c2 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 08:47:50 +00:00
Fedora Release Engineering
8b14bb274c Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 13:46:00 +00:00
Fedora Release Engineering
fb2af78a80 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 07:52:32 +00:00
Remi Collet
138a26f285 v1.9.1 2021-11-24 09:31:21 +01:00
Fedora Release Engineering
a96f94bb09 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 02:29:33 +00:00
5 changed files with 82 additions and 153 deletions

2
.gitignore vendored
View file

@ -13,3 +13,5 @@ php-markdown-1.0.1n.zip
/php-markdown-lib-1.8.0.zip
/php-markdown-1.8.0-01ab082.tgz
/php-markdown-1.9.0-c83178d.tgz
/php-markdown-1.9.1-5024d62.tgz
/php-markdown-2.0.0.tar.gz

View file

@ -18,12 +18,37 @@
}
],
"require": {
"php": ">=5.3.0"
"php": ">=7.4"
},
"autoload": {
"psr-4": { "Michelf\\": "Michelf/" }
},
"require-dev": {
"phpunit/phpunit": ">=4.3 <5.8"
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": ">=1.0",
"phpstan/phpstan-phpunit": ">=1.0"
},
"scripts": {
"tests": "vendor/bin/phpunit test/",
"phpstan": [
"vendor/bin/phpstan analyse Michelf/ --level=5",
"vendor/bin/phpstan analyse -c test/phpstan.neon test/ --level=5"
],
"codestyle": "vendor/bin/php-cs-fixer fix Michelf --dry-run --verbose --show-progress=none",
"codestyle-fix": "vendor/bin/php-cs-fixer fix Michelf"
},
"archive": {
"exclude": [
"/.github/",
"/test/",
"/.editorconfig",
"/.gitignore",
"/.scrutinizer.yml",
"/.travis.yml",
"/phpunit.xml.dist"
]
}
}

View file

@ -1,137 +0,0 @@
diff -up Michelf/MarkdownExtra.php.php74 Michelf/MarkdownExtra.php
--- Michelf/MarkdownExtra.php.php74 2019-07-26 15:03:52.000000000 +0200
+++ Michelf/MarkdownExtra.php 2019-07-26 15:07:25.255088870 +0200
@@ -212,9 +212,9 @@ class MarkdownExtra extends \Michelf\Mar
$attributes = array();
$id = false;
foreach ($elements as $element) {
- if ($element{0} == '.') {
+ if ($element[0] == '.') {
$classes[] = substr($element, 1);
- } else if ($element{0} == '#') {
+ } else if ($element[0] == '#') {
if ($id === false) $id = substr($element, 1);
} else if (strpos($element, '=') > 0) {
$parts = explode('=', $element, 2);
@@ -508,14 +508,14 @@ class MarkdownExtra extends \Michelf\Mar
}
}
// Check for: Indented code block.
- else if ($tag{0} == "\n" || $tag{0} == " ") {
+ else if ($tag[0] == "\n" || $tag[0] == " ") {
// Indented code block: pass it unchanged, will be handled
// later.
$parsed .= $tag;
}
// Check for: Code span marker
// Note: need to check this after backtick fenced code blocks
- else if ($tag{0} == "`") {
+ else if ($tag[0] == "`") {
// Find corresponding end marker.
$tag_re = preg_quote($tag);
if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)' . $tag_re . '(?!`)}',
@@ -549,7 +549,7 @@ class MarkdownExtra extends \Michelf\Mar
// Check for: Clean tag (like script, math)
// HTML Comments, processing instructions.
else if (preg_match('{^<(?:' . $this->clean_tags_re . ')\b}', $tag) ||
- $tag{1} == '!' || $tag{1} == '?')
+ $tag[1] == '!' || $tag[1] == '?')
{
// Need to parse tag and following text using the HTML parser.
// (don't check for markdown attribute)
@@ -564,7 +564,7 @@ class MarkdownExtra extends \Michelf\Mar
preg_match('{^</?(?:' . $enclosing_tag_re . ')\b}', $tag))
{
// Increase/decrease nested tag count.
- if ($tag{1} == '/') $depth--;
+ if ($tag[1] == '/') $depth--;
else if ($tag{strlen($tag)-2} != '/') $depth++;
if ($depth < 0) {
@@ -664,7 +664,7 @@ class MarkdownExtra extends \Michelf\Mar
// In that case, we return original text unchanged and pass the
// first character as filtered to prevent an infinite loop in the
// parent function.
- return array($original_text{0}, substr($original_text, 1));
+ return array($original_text[0], substr($original_text, 1));
}
$block_text .= $parts[0]; // Text before current tag.
@@ -674,7 +674,7 @@ class MarkdownExtra extends \Michelf\Mar
// Check for: Auto-close tag (like <hr/>)
// Comments and Processing Instructions.
if (preg_match('{^</?(?:' . $this->auto_close_tags_re . ')\b}', $tag) ||
- $tag{1} == '!' || $tag{1} == '?')
+ $tag[1] == '!' || $tag[1] == '?')
{
// Just add the tag to the block as if it was text.
$block_text .= $tag;
@@ -683,7 +683,7 @@ class MarkdownExtra extends \Michelf\Mar
// Increase/decrease nested tag count. Only do so if
// the tag's name match base tag's.
if (preg_match('{^</?' . $base_tag_name_re . '\b}', $tag)) {
- if ($tag{1} == '/') $depth--;
+ if ($tag[1] == '/') $depth--;
else if ($tag{strlen($tag)-2} != '/') $depth++;
}
@@ -1071,7 +1071,7 @@ class MarkdownExtra extends \Michelf\Mar
return $matches[0];
}
- $level = $matches[3]{0} == '=' ? 1 : 2;
+ $level = $matches[3][0] == '=' ? 1 : 2;
$defaultId = is_callable($this->header_id_func) ? call_user_func($this->header_id_func, $matches[1]) : null;
@@ -1466,7 +1466,7 @@ class MarkdownExtra extends \Michelf\Mar
$classes = array();
if ($classname != "") {
- if ($classname{0} == '.')
+ if ($classname[0] == '.')
$classname = substr($classname, 1);
$classes[] = $this->code_class_prefix . $classname;
}
diff -up Michelf/Markdown.php.php74 Michelf/Markdown.php
--- Michelf/Markdown.php.php74 2019-07-26 15:03:52.000000000 +0200
+++ Michelf/Markdown.php 2019-07-26 15:06:27.924736197 +0200
@@ -952,7 +952,7 @@ class Markdown implements MarkdownInterf
return $matches[0];
}
- $level = $matches[2]{0} == '=' ? 1 : 2;
+ $level = $matches[2][0] == '=' ? 1 : 2;
// ID attribute generation
$idAtt = $this->_generateIdFromHeaderValue($matches[1]);
@@ -1358,7 +1358,7 @@ class Markdown implements MarkdownInterf
} else {
// Other closing marker: close one em or strong and
// change current token state to match the other
- $token_stack[0] = str_repeat($token{0}, 3-$token_len);
+ $token_stack[0] = str_repeat($token[0], 3-$token_len);
$tag = $token_len == 2 ? "strong" : "em";
$span = $text_stack[0];
$span = $this->runSpanGamut($span);
@@ -1383,7 +1383,7 @@ class Markdown implements MarkdownInterf
} else {
// Reached opening three-char emphasis marker. Push on token
// stack; will be handled by the special condition above.
- $em = $token{0};
+ $em = $token[0];
$strong = "$em$em";
array_unshift($token_stack, $token);
array_unshift($text_stack, '');
@@ -1796,9 +1796,9 @@ class Markdown implements MarkdownInterf
* @return string
*/
protected function handleSpanToken($token, &$str) {
- switch ($token{0}) {
+ switch ($token[0]) {
case "\\":
- return $this->hashPart("&#". ord($token{1}). ";");
+ return $this->hashPart("&#". ord($token[1]). ";");
case "`":
// Search for end marker in remaining text.
if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm',

View file

@ -5,19 +5,19 @@
#
# Please preserve changelog entries
#
%global gh_commit c83178d49e372ca967d1a8c77ae4e051b3a3c75c
%global gh_commit 5024d623c1a057dcd2d076d25b7d270a1d0d55f3
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner michelf
%global gh_project php-markdown
Name: php-markdown
Version: 1.9.0
Release: 4%{?dist}
Version: 2.0.0
Release: 7%{?dist}
Summary: Markdown implementation in PHP
License: BSD
License: BSD-3-Clause
URL: https://michelf.ca/projects/php-markdown/
Source0: %{name}-%{version}-%{gh_short}.tgz
Source0: https://github.com/michelf/php-markdown/archive/%{version}/%{name}-%{version}.tar.gz
Source1: makesrc.sh
BuildArch: noarch
@ -25,9 +25,9 @@ BuildRequires: php-fedora-autoloader-devel
# For tests
# "require-dev": {
# "phpunit/phpunit": ">=4.3 <5.8"
BuildRequires: phpunit
BuildRequires: phpunit10
Requires: php(language) >= 5.3
Requires: php(language) >= 7.4
Requires: php-pcre
Requires: php-composer(fedora/autoloader)
@ -38,14 +38,11 @@ Provides: php-composer(michelf/php-markdown) = %{version}
This is a PHP implementation of John Gruber's Markdown.
It is almost completely compliant with the reference implementation.
This packages provides the classic version %{classic_version} and the new
library version %{version}.
Autoloader: %{_datadir}/php/Michelf/markdown-autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%setup -q
mv License.md LICENSE
@ -79,11 +76,11 @@ require "test/bootstrap.php";
EOF
ret=0
for php in php php72 php73 php74
for php in php php74 php81 php82 php83
do
if which $php
then
$php %{_bindir}/phpunit --bootstrap bs.php || ret=1
$php %{_bindir}/phpunit10 --bootstrap bs.php || ret=1
fi
done
exit $ret
@ -99,6 +96,48 @@ exit $ret
%changelog
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sun Mar 23 2025 Tim Landscheidt <tim@tim-landscheidt.de> - 2.0.0-6
- Remove outdated information from package description
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Oct 04 2023 Sérgio Basto <sergio@serjux.com> - 2.0.0-1
- Update php-markdown to 2.0.0
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Mar 01 2023 Gwyn Ciesla <gwync@protonmail.com> - 1.9.1-5
- migrated to SPDX license
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Nov 24 2021 Remi Collet <remi@remirepo.net> - 1.9.1-1
- update to 1.9.1
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View file

@ -1 +1 @@
SHA512 (php-markdown-1.9.0-c83178d.tgz) = 3f4564ed999f16e822ec409fed66114b54b17aa2676bc53a04d35e5e721908c5980dd7a5f7b10cfdc1f08fa44dbf3fedf537c5d5705e74b71d0f56372ab80790
SHA512 (php-markdown-2.0.0.tar.gz) = a848bc7374f8392d21824acbc1fb11c37f961e1780fb2c735a4d4d09949fb51a6962d8d2f6df2dfca92d00a33da82062d5e2a8b8301cb476242e1fc17af673b5