mirror of
https://github.com/progsource/maddy.git
synced 2026-03-24 23:40:39 +01:00
Release 1.4.0
* up version to 1.4.0 * Remove deprecated code * change release message
This commit is contained in:
3
.github/ISSUE_TEMPLATE/cpp-bug-report.yml
vendored
3
.github/ISSUE_TEMPLATE/cpp-bug-report.yml
vendored
@@ -37,7 +37,8 @@ body:
|
|||||||
label: maddy version
|
label: maddy version
|
||||||
description: What version of maddy are you using?
|
description: What version of maddy are you using?
|
||||||
options:
|
options:
|
||||||
- 1.3.0 (latest)
|
- 1.4.0 (latest)
|
||||||
|
- 1.3.0
|
||||||
- 1.2.1
|
- 1.2.1
|
||||||
- 1.2.0
|
- 1.2.0
|
||||||
- 1.1.2
|
- 1.1.2
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ body:
|
|||||||
label: maddy version
|
label: maddy version
|
||||||
description: What version of maddy are you using?
|
description: What version of maddy are you using?
|
||||||
options:
|
options:
|
||||||
- 1.3.0 (latest)
|
- 1.4.0 (latest)
|
||||||
|
- 1.3.0
|
||||||
- 1.2.1
|
- 1.2.1
|
||||||
- 1.2.0
|
- 1.2.0
|
||||||
- 1.1.2
|
- 1.1.2
|
||||||
|
|||||||
16
.github/workflows/create-release-package.yml
vendored
16
.github/workflows/create-release-package.yml
vendored
@@ -25,10 +25,24 @@ jobs:
|
|||||||
cmake -DMADDY_CREATE_PACKAGE=ON ..
|
cmake -DMADDY_CREATE_PACKAGE=ON ..
|
||||||
make maddy_package
|
make maddy_package
|
||||||
|
|
||||||
|
- name: Get current tag message
|
||||||
|
id: tag-message
|
||||||
|
run: |
|
||||||
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
|
TAG_MESSAGE=$(git for-each-ref refs/tags/$TAG_NAME --format='%(contents)')
|
||||||
|
echo "message<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "$TAG_MESSAGE" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: create release
|
- name: create release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: build/maddy-src.zip
|
file: build/maddy-src.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
body: "You can find all changes of this release in the [changelog](https://github.com/progsource/maddy/blob/master/CHANGELOG.md)"
|
body: |
|
||||||
|
${{ steps.tag-message.outputs.message }}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
You can find all changes of this release in the [changelog](https://github.com/progsource/maddy/blob/master/CHANGELOG.md)
|
||||||
|
|||||||
6
.github/workflows/run-checks.yml
vendored
6
.github/workflows/run-checks.yml
vendored
@@ -1,11 +1,13 @@
|
|||||||
name: run-checks
|
name: run-checks
|
||||||
|
run-name: run-checks ${{ github.ref }}
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
|
pull_request_target:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
run-clang-format:
|
run-clang-format:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|||||||
6
.github/workflows/run-tests.yml
vendored
6
.github/workflows/run-tests.yml
vendored
@@ -1,11 +1,13 @@
|
|||||||
name: run-tests
|
name: run-tests
|
||||||
run-name: test ${{ github.ref }}
|
run-name: test ${{ github.ref }}
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- dev
|
pull_request:
|
||||||
|
pull_request_target:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
test-on-ubuntu:
|
test-on-ubuntu:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -14,10 +14,13 @@ maddy uses [semver versioning](https://semver.org/).
|
|||||||
|
|
||||||
## Upcoming
|
## Upcoming
|
||||||
|
|
||||||
|
## version 1.4.0 2025-03-28
|
||||||
|
|
||||||
*  Updated google test to v1.16.0.
|
*  Updated google test to v1.16.0.
|
||||||
*  clang-format
|
*  clang-format
|
||||||
*  automatic update dependencies ci
|
*  automatic update dependencies ci
|
||||||
*  `(This is a [link](/ABC/some file) (the URL will include this).)` should not put the later parenthesis into the link url.
|
*  `(This is a [link](/ABC/some file) (the URL will include this).)` should not put the later parenthesis into the link url.
|
||||||
|
*  config flags `isEmphasizedParserEnabled` and `isHTMLWrappedInParagraph`. Use `config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER;` and `config->enabledParsers |= maddy::types::HTML_PARSER;` to gain the same behavior as if the previous config flags were set to `false`.
|
||||||
|
|
||||||
## version 1.3.0 2023-08-26
|
## version 1.3.0 2023-08-26
|
||||||
|
|
||||||
|
|||||||
@@ -10,17 +10,10 @@ improve the code? Then [create a GitHub issue](https://github.com/progsource/mad
|
|||||||
## Creating Pull-Requests
|
## Creating Pull-Requests
|
||||||
|
|
||||||
* Use a branch other than master.
|
* Use a branch other than master.
|
||||||
* Add yourself to the `AUTHORS` file.
|
* Feel free to add yourself to the `AUTHORS` file. (optional)
|
||||||
* Try to stick with the code style the files are having right now.
|
* Use clang-format to format the code.
|
||||||
* Write in your commit messages what/why you did something. Often times a one-liner might be enough, but if you want to write more, make an empty line in between like:
|
* Write in your commit messages what/why you did something. Often times a one-liner might be enough.
|
||||||
```
|
|
||||||
Short description
|
|
||||||
|
|
||||||
More and longer text for the commit message with some more information.
|
|
||||||
That can go over multiple lines.
|
|
||||||
```
|
|
||||||
Do not include Github issue ticket numbers inside commit messages.
|
|
||||||
* Explain for what your PR is for - like providing a use-case or something similar.
|
* Explain for what your PR is for - like providing a use-case or something similar.
|
||||||
* Update documentation of the Markdown syntax if anything changed there. (`docs/definitions.md`)
|
* Update documentation of the Markdown syntax if anything changed there. (`docs/definitions.md`)
|
||||||
* Add a changelog entry at "Upcoming" inside of `CHANGELOG.md`
|
* Add a changelog entry at "Upcoming" inside of `CHANGELOG.md`
|
||||||
* Make sure, that the tests are successful.
|
* Make sure, that the tests are successful and if you wrote a bugfix, to have a test, that highlights the issue.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# maddy
|
# maddy
|
||||||
|
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://semver.org/)
|
[](https://semver.org/)
|
||||||
|
|
||||||
maddy is a C++ Markdown to HTML **header-only** parser library.
|
maddy is a C++ Markdown to HTML **header-only** parser library.
|
||||||
|
|
||||||
@@ -70,10 +70,8 @@ std::stringstream markdownInput("");
|
|||||||
|
|
||||||
// config is optional
|
// config is optional
|
||||||
std::shared_ptr<maddy::ParserConfig> config = std::make_shared<maddy::ParserConfig>();
|
std::shared_ptr<maddy::ParserConfig> config = std::make_shared<maddy::ParserConfig>();
|
||||||
// config->isEmphasizedParserEnabled = false; // default true - this flag is deprecated
|
config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER; // disable emphasized parser
|
||||||
// config->isHTMLWrappedInParagraph = false; // default true - this flag is deprecated
|
config->enabledParsers |= maddy::types::HTML_PARSER; // do not wrap HTML in paragraph
|
||||||
config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER; // equivalent to !isEmphasizedParserEnabled
|
|
||||||
config->enabledParsers |= maddy::types::HTML_PARSER; // equivalent to !isHTMLWrappedInParagraph
|
|
||||||
|
|
||||||
std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>(config);
|
std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>(config);
|
||||||
std::string htmlOutput = parser->Parse(markdownInput);
|
std::string htmlOutput = parser->Parse(markdownInput);
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ destroy the output, if there was HTML in your markdown.
|
|||||||
The Parser expects you to use spaces and not tabs for indentation in the
|
The Parser expects you to use spaces and not tabs for indentation in the
|
||||||
markdown.
|
markdown.
|
||||||
|
|
||||||
If a line starts with `<` and `config->isHTMLWrappedInParagraph` is false, it
|
If a line starts with `<` and `config->enabledParsers |= maddy::types::HTML_PARSER;`
|
||||||
expects that the upcoming line is HTML and therefor will not be surrounded by a
|
is set, it expects that the upcoming line is HTML and therefor will not be
|
||||||
paragraph.
|
surrounded by a paragraph.
|
||||||
|
|
||||||
## Headlines
|
## Headlines
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ results in
|
|||||||
|
|
||||||
## emphasized
|
## emphasized
|
||||||
|
|
||||||
This can be disabled by setting `config->isEmphasizedParserEnabled = false`.
|
This can be disabled by setting `config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER;`.
|
||||||
|
|
||||||
```
|
```
|
||||||
_emphasized text_
|
_emphasized text_
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static const std::string& version()
|
static const std::string& version()
|
||||||
{
|
{
|
||||||
static const std::string v = "1.3.0";
|
static const std::string v = "1.4.0";
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,17 +72,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
Parser(std::shared_ptr<ParserConfig> config = nullptr) : config(config)
|
Parser(std::shared_ptr<ParserConfig> config = nullptr) : config(config)
|
||||||
{
|
{
|
||||||
// deprecated backward compatibility
|
|
||||||
// will be removed in 1.4.0 latest including the booleans
|
|
||||||
if (this->config && !this->config->isEmphasizedParserEnabled)
|
|
||||||
{
|
|
||||||
this->config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER;
|
|
||||||
}
|
|
||||||
if (this->config && !this->config->isHTMLWrappedInParagraph)
|
|
||||||
{
|
|
||||||
this->config->enabledParsers |= maddy::types::HTML_PARSER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this->config ||
|
if (!this->config ||
|
||||||
(this->config->enabledParsers & maddy::types::BREAKLINE_PARSER) != 0)
|
(this->config->enabledParsers & maddy::types::BREAKLINE_PARSER) != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -58,20 +58,6 @@ enum PARSER_TYPE : uint32_t
|
|||||||
*/
|
*/
|
||||||
struct ParserConfig
|
struct ParserConfig
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @deprecated will be removed in 1.4.0 latest
|
|
||||||
*
|
|
||||||
* this flag = false == `enabledParsers &= ~maddy::types::EMPHASIZED_PARSER`
|
|
||||||
*/
|
|
||||||
bool isEmphasizedParserEnabled;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated will be removed in 1.4.0 latest
|
|
||||||
*
|
|
||||||
* this flag = false == `enabledParsers |= maddy::types::HTML_PARSER`
|
|
||||||
*/
|
|
||||||
bool isHTMLWrappedInParagraph;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* en-/disable headline inline-parsing
|
* en-/disable headline inline-parsing
|
||||||
*
|
*
|
||||||
@@ -85,9 +71,7 @@ struct ParserConfig
|
|||||||
uint32_t enabledParsers;
|
uint32_t enabledParsers;
|
||||||
|
|
||||||
ParserConfig()
|
ParserConfig()
|
||||||
: isEmphasizedParserEnabled(true)
|
: isHeadlineInlineParsingEnabled(true)
|
||||||
, isHTMLWrappedInParagraph(true)
|
|
||||||
, isHeadlineInlineParsingEnabled(true)
|
|
||||||
, enabledParsers(maddy::types::DEFAULT)
|
, enabledParsers(maddy::types::DEFAULT)
|
||||||
{}
|
{}
|
||||||
}; // class ParserConfig
|
}; // class ParserConfig
|
||||||
|
|||||||
@@ -21,21 +21,6 @@ TEST(MADDY_PARSER, ItShouldParse)
|
|||||||
ASSERT_EQ(testHtml, output);
|
ASSERT_EQ(testHtml, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MADDY_PARSER, ItShouldParseWithConfig)
|
|
||||||
{
|
|
||||||
auto config = std::make_shared<maddy::ParserConfig>();
|
|
||||||
config->isEmphasizedParserEnabled = false;
|
|
||||||
config->isHTMLWrappedInParagraph = false;
|
|
||||||
|
|
||||||
auto parser = std::make_shared<maddy::Parser>(config);
|
|
||||||
|
|
||||||
std::stringstream markdown(testMarkdown);
|
|
||||||
|
|
||||||
const std::string output = parser->Parse(markdown);
|
|
||||||
|
|
||||||
ASSERT_EQ(testHtml2, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(MADDY_PARSER, ItShouldParseWithBitwiseConfig)
|
TEST(MADDY_PARSER, ItShouldParseWithBitwiseConfig)
|
||||||
{
|
{
|
||||||
auto config = std::make_shared<maddy::ParserConfig>();
|
auto config = std::make_shared<maddy::ParserConfig>();
|
||||||
|
|||||||
Reference in New Issue
Block a user