mirror of
https://github.com/progsource/maddy.git
synced 2026-03-24 23:40:39 +01:00
62
.github/ISSUE_TEMPLATE/cpp-bug-report.yml
vendored
Normal file
62
.github/ISSUE_TEMPLATE/cpp-bug-report.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
name: C++ Bug Report
|
||||
description: File a bug report regarding C++ problems
|
||||
title: "[Bug][C++]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating System
|
||||
description: On which OS are you running maddy?
|
||||
placeholder: ex. Windows/Linux/OSX
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: compiler
|
||||
attributes:
|
||||
label: Compiler
|
||||
description: Which compiler do you use?
|
||||
placeholder: ex. mingw/Visual Studio/clang
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: compiler_flags
|
||||
attributes:
|
||||
label: Compiler flags
|
||||
description: Which compiler flags do you use?
|
||||
placeholder: ex. -fno-rtti
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: maddy_version
|
||||
attributes:
|
||||
label: maddy version
|
||||
description: What version of maddy are you using?
|
||||
options:
|
||||
- 1.2.0 (latest)
|
||||
- 1.1.2
|
||||
- 1.1.1
|
||||
- 1.1.0
|
||||
- 1.0.3
|
||||
- 1.0.2
|
||||
- 1.0.1
|
||||
- 1.0.0
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: example
|
||||
label: Minimal C++ example
|
||||
description: To be able to reproduce your issue, please give some example C++ code which creates problems.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: whats-wrong
|
||||
attributes:
|
||||
label: What is not working? What did you try?
|
||||
description: Also, what did you expect to happen?
|
||||
validations:
|
||||
required: true
|
||||
15
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
15
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Feature Request
|
||||
description: Missing some feature?
|
||||
labels: ["feature"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to create a feature request!
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: What are you missing in maddy?
|
||||
description: If you want some extra Markdown supported, please also write a Markdown example and an expected HTML output.
|
||||
validations:
|
||||
required: true
|
||||
62
.github/ISSUE_TEMPLATE/markdown-bug-report.yml
vendored
Normal file
62
.github/ISSUE_TEMPLATE/markdown-bug-report.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
name: Markdown Bug Report
|
||||
description: File a bug report regarding Markdown problems
|
||||
title: "[Bug][Markdown]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating System
|
||||
description: On which OS are you running maddy?
|
||||
placeholder: ex. Windows/Linux/OSX
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: compiler
|
||||
attributes:
|
||||
label: Compiler
|
||||
description: Which compiler do you use?
|
||||
placeholder: ex. mingw/Visual Studio/clang
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: compiler_flags
|
||||
attributes:
|
||||
label: Compiler flags
|
||||
description: Which compiler flags do you use?
|
||||
placeholder: ex. -fno-rtti
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: maddy_version
|
||||
attributes:
|
||||
label: maddy version
|
||||
description: What version of maddy are you using?
|
||||
options:
|
||||
- 1.2.0 (latest)
|
||||
- 1.1.2
|
||||
- 1.1.1
|
||||
- 1.1.0
|
||||
- 1.0.3
|
||||
- 1.0.2
|
||||
- 1.0.1
|
||||
- 1.0.0
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: example
|
||||
label: Minimal Mardown example
|
||||
description: To be able to reproduce your issue, please give some example Markdown which creates problems.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: whats-wrong
|
||||
attributes:
|
||||
label: What is not working? What did you try?
|
||||
description: Also, what did you expect to happen?
|
||||
validations:
|
||||
required: true
|
||||
33
.github/workflows/create-release-package.yml
vendored
Normal file
33
.github/workflows/create-release-package.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: release
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version
|
||||
ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version
|
||||
|
||||
- name: create zip
|
||||
run: |
|
||||
mkdir tmp
|
||||
cd tmp
|
||||
cmake -DMADDY_CREATE_PACKAGE=ON ..
|
||||
make maddy_package
|
||||
|
||||
- name: create release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: build/maddy-src.zip
|
||||
tag: ${{ github.ref }}
|
||||
body: "You can find all changes of this release in the [changelog](https://github.com/progsource/maddy/blob/master/CHANGELOG.md)"
|
||||
2
.github/workflows/run-tests.yml
vendored
2
.github/workflows/run-tests.yml
vendored
@@ -25,6 +25,7 @@ jobs:
|
||||
- name: run tests
|
||||
run: |
|
||||
./build/MaddyTests
|
||||
|
||||
test-on-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
@@ -42,6 +43,7 @@ jobs:
|
||||
- name: run tests
|
||||
run: |
|
||||
./build/Debug/MaddyTests.exe
|
||||
|
||||
test-on-osx:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
|
||||
@@ -14,18 +14,23 @@ maddy uses [semver versioning](https://semver.org/).
|
||||
|
||||
## Upcoming
|
||||
|
||||
* ?
|
||||
|
||||
## version 1.2.0 2023-07-27
|
||||
|
||||
*  Added Changelog
|
||||
*  Added contribution guideline
|
||||
*  updated cmake minimum required version to 3.25
|
||||
*  gtest is now loaded via cmake and not a git submodule any longer - updated gtest version to 1.13.0
|
||||
*  tests are only run if the cmake option `MADDY_BUILD_WITH_TESTS` is on, moved test cmake code to the `tests` subfolder
|
||||
*  travis CI and appveyor
|
||||
*  GitHub workflow
|
||||
*  GitHub workflow for tests
|
||||
*  config flags `isEmphasizedParserEnabled` and `isHTMLWrappedInParagraph`
|
||||
*  config flag `enabledParsers` to en-/disable each parser separately
|
||||
*  class attribute to code blocks if there is text after the three backticks like ` ```cpp`
|
||||
*  optional support for latex blocks - it's off by default
|
||||
* ?
|
||||
*  version info to the parser class
|
||||
*  GitHub workflow for release, so that one can include maddy easier via cmake's `FetchContent`
|
||||
|
||||
## version 1.1.2 2020-10-04
|
||||
|
||||
|
||||
@@ -7,49 +7,33 @@ project(maddy)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
set(MADDY_CPP_VERSION 14)
|
||||
add_definitions(-DCPP_VERSION=${MADDY_CPP_VERSION})
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
option(MADDY_BUILD_WITH_TESTS "enable building tests" OFF)
|
||||
option(MADDY_BUILD_WITH_TESTS "enable building tests - does not work with zip download" OFF)
|
||||
|
||||
if(${MADDY_BUILD_WITH_TESTS})
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
option(MADDY_CREATE_PACKAGE "create a package for a version release" OFF)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
set(MADDY_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
if (UNIX)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -g -std=c++${MADDY_CPP_VERSION} -Wall -Wpedantic -Wextra -Wno-ignored-qualifiers -fno-rtti -fno-exceptions -fsanitize=address -fno-omit-frame-pointer"
|
||||
)
|
||||
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
|
||||
-fuse-ld=gold -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE ld_version)
|
||||
if ("${ld_version}" MATCHES "GNU gold")
|
||||
message(STATUS "Found Gold linker, use faster linker")
|
||||
set(CMAKE_EXE_LINKER_FLAGS
|
||||
"${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS
|
||||
"${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold ")
|
||||
endif()
|
||||
if(${CMAKE_CXX_STANDARD} LESS 14)
|
||||
message(FATAL_ERROR "maddy requires >=C++14")
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -64,3 +48,14 @@ target_include_directories(maddy INTERFACE
|
||||
if(${MADDY_BUILD_WITH_TESTS})
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
if(${MADDY_CREATE_PACKAGE})
|
||||
set(MADDY_PACKAGE_FILES include/ CMakeLists.txt LICENSE)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-src.zip
|
||||
COMMAND ${CMAKE_COMMAND} -E tar c ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-src.zip --format=zip -- ${MADDY_PACKAGE_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${MADDY_PACKAGE_FILES})
|
||||
add_custom_target(${PROJECT_NAME}_package DEPENDS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-src.zip)
|
||||
endif()
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
## Minimal Code Example
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
## Conditions
|
||||
|
||||
. | .
|
||||
--------------------- | ------------------
|
||||
**Operating System:** | ?
|
||||
**Compiler:** | ?
|
||||
**Compiler flags:** | ?
|
||||
**maddy version:** | ?
|
||||
|
||||
## Description
|
||||
|
||||
What did you try? What is not working?
|
||||
41
README.md
41
README.md
@@ -1,7 +1,7 @@
|
||||
# maddy
|
||||
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://semver.org/)
|
||||
[](https://semver.org/)
|
||||
|
||||
maddy is a C++ Markdown to HTML **header-only** parser library.
|
||||
|
||||
@@ -21,13 +21,40 @@ It is tested to work on:
|
||||
|
||||
## Why maddy?
|
||||
|
||||
When I was needing a Markdown parser in C++ I couldn't find any, that was
|
||||
When I was looking for a Markdown parser in C++, I couldn't find any, that was
|
||||
fitting my needs. So I simply wrote my own one.
|
||||
|
||||
## Markdown syntax
|
||||
|
||||
The supported syntax can be found in the [definitions docs](docs/definitions.md).
|
||||
|
||||
## How to add maddy to your cmake project
|
||||
|
||||
You can use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
|
||||
which was introduced in CMake 3.11.
|
||||
|
||||
This way you can add
|
||||
|
||||
```cmake
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
maddy
|
||||
URL https://github.com/progsource/maddy/.../maddy-src.zip
|
||||
)
|
||||
FetchContent_MakeAvailable(maddy)
|
||||
|
||||
add_executable(my_exe)
|
||||
target_link_libraries(my_exe PUBLIC maddy)
|
||||
```
|
||||
|
||||
to your CMake file to make it work. Check the
|
||||
[release](https://github.com/progsource/maddy/releases) for the full
|
||||
zip-file-url.
|
||||
|
||||
The zip only contains a `CMakeLists.txt`, the `include` folder and the `LICENSE`
|
||||
file.
|
||||
|
||||
## How to use
|
||||
|
||||
To use maddy in your project, simply add the include path of maddy to yours
|
||||
@@ -45,14 +72,15 @@ std::stringstream markdownInput("");
|
||||
std::shared_ptr<maddy::ParserConfig> config = std::make_shared<maddy::ParserConfig>();
|
||||
// config->isEmphasizedParserEnabled = false; // default true - this flag is deprecated
|
||||
// config->isHTMLWrappedInParagraph = false; // default true - this flag is deprecated
|
||||
config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER;
|
||||
config->enabledParsers |= maddy::types::HTML_PARSER;
|
||||
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::string htmlOutput = parser->Parse(markdownInput);
|
||||
```
|
||||
|
||||
You can find all parser flags in [`include/maddy/parserconfig.h`](include/maddy/parserconfig.h).
|
||||
You can find all parser flags in
|
||||
[`include/maddy/parserconfig.h`](include/maddy/parserconfig.h).
|
||||
|
||||
## How to run the tests
|
||||
|
||||
@@ -77,7 +105,6 @@ make test # or run the executable in ../build/MaddyTests
|
||||
There are different possibilities:
|
||||
|
||||
* [Create a GitHub issue](https://github.com/progsource/maddy/issues/new)
|
||||
* Create a pull request with an own branch (don't forget to put yourself in the
|
||||
AUTHORS file)
|
||||
* Create a pull request with an own branch
|
||||
|
||||
Please also read [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
static bool
|
||||
IsStartingLine(const std::string& line)
|
||||
{
|
||||
static std::regex re("^- \\[[x| ]\\] .*");
|
||||
static std::regex re(R"(^- \[[x| ]\] .*)");
|
||||
return std::regex_match(line, re);
|
||||
}
|
||||
|
||||
@@ -92,11 +92,11 @@ protected:
|
||||
static std::regex lineRegex("^(- )");
|
||||
line = std::regex_replace(line, lineRegex, "");
|
||||
|
||||
static std::regex emptyBoxRegex("^\\[ \\]");
|
||||
static std::regex emptyBoxRegex(R"(^\[ \])");
|
||||
static std::string emptyBoxReplacement = "<input type=\"checkbox\"/>";
|
||||
line = std::regex_replace(line, emptyBoxRegex, emptyBoxReplacement);
|
||||
|
||||
static std::regex boxRegex("^\\[x\\]");
|
||||
static std::regex boxRegex(R"(^\[x\])");
|
||||
static std::string boxReplacement = "<input type=\"checkbox\" checked=\"checked\"/>";
|
||||
line = std::regex_replace(line, boxRegex, boxReplacement);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
void
|
||||
Parse(std::string& line) override
|
||||
{
|
||||
static std::regex re("(?!.*`.*|.*<code>.*)_(?!.*`.*|.*<\\/code>.*)([^_]*)_(?!.*`.*|.*<\\/code>.*)");
|
||||
static std::regex re(R"((?!.*`.*|.*<code>.*)_(?!.*`.*|.*<\/code>.*)([^_]*)_(?!.*`.*|.*<\/code>.*))");
|
||||
static std::string replacement = "<em>$1</em>";
|
||||
|
||||
line = std::regex_replace(line, re, replacement);
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
void
|
||||
Parse(std::string& line) override
|
||||
{
|
||||
static std::regex re("\\!\\[([^\\]]*)\\]\\(([^\\]]*)\\)");
|
||||
static std::regex re(R"(\!\[([^\]]*)\]\(([^\]]*)\))");
|
||||
static std::string replacement = "<img src=\"$2\" alt=\"$1\"/>";
|
||||
|
||||
line = std::regex_replace(line, re, replacement);
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
void
|
||||
Parse(std::string& line) override
|
||||
{
|
||||
static std::regex re("(?!.*`.*|.*<code>.*)\\*(?!.*`.*|.*<\\/code>.*)([^\\*]*)\\*(?!.*`.*|.*<\\/code>.*)");
|
||||
static std::regex re(R"((?!.*`.*|.*<code>.*)\*(?!.*`.*|.*<\/code>.*)([^\*]*)\*(?!.*`.*|.*<\/code>.*))");
|
||||
static std::string replacement = "<i>$1</i>";
|
||||
line = std::regex_replace(line, re, replacement);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
static bool
|
||||
IsStartingLine(const std::string& line)
|
||||
{
|
||||
static std::regex re("^(?:\\$){2}(.*)$");
|
||||
static std::regex re(R"(^(?:\$){2}(.*)$)");
|
||||
return std::regex_match(line, re);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
void
|
||||
Parse(std::string& line) override
|
||||
{
|
||||
static std::regex re("\\[([^\\]]*)\\]\\(([^\\]]*)\\)");
|
||||
static std::regex re(R"(\[([^\]]*)\]\(([^\]]*)\))");
|
||||
static std::string replacement = "<a href=\"$2\">$1</a>";
|
||||
|
||||
line = std::regex_replace(line, re, replacement);
|
||||
|
||||
@@ -89,9 +89,9 @@ protected:
|
||||
bool isStartOfNewListItem = this->isStartOfNewListItem(line);
|
||||
uint32_t indentation = getIndentationWidth(line);
|
||||
|
||||
static std::regex orderedlineRegex("^[1-9]+[0-9]*\\. ");
|
||||
static std::regex orderedlineRegex(R"(^[1-9]+[0-9]*\. )");
|
||||
line = std::regex_replace(line, orderedlineRegex, "");
|
||||
static std::regex unorderedlineRegex("^\\* ");
|
||||
static std::regex unorderedlineRegex(R"(^\* )");
|
||||
line = std::regex_replace(line, unorderedlineRegex, "");
|
||||
|
||||
if (!this->isStarted)
|
||||
@@ -132,7 +132,7 @@ private:
|
||||
bool
|
||||
isStartOfNewListItem(const std::string& line) const
|
||||
{
|
||||
static std::regex re("^(?:[1-9]+[0-9]*\\. |\\* ).*");
|
||||
static std::regex re(R"(^(?:[1-9]+[0-9]*\. |\* ).*)");
|
||||
return std::regex_match(line, re);
|
||||
}
|
||||
}; // class OrderedListParser
|
||||
|
||||
@@ -51,6 +51,14 @@ namespace maddy {
|
||||
class Parser
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Version info
|
||||
*
|
||||
* Check https://github.com/progsource/maddy/blob/master/CHANGELOG.md
|
||||
* for the changelog.
|
||||
*/
|
||||
static const std::string VERSION() { static const std::string v = "1.2.0"; return v; }
|
||||
|
||||
/**
|
||||
* ctor
|
||||
*
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
static bool
|
||||
IsStartingLine(const std::string& line)
|
||||
{
|
||||
static std::regex re("^\\>.*");
|
||||
static std::regex re(R"(^\>.*)");
|
||||
return std::regex_match(line, re);
|
||||
}
|
||||
|
||||
@@ -144,9 +144,9 @@ protected:
|
||||
void
|
||||
parseBlock(std::string& line) override
|
||||
{
|
||||
static std::regex lineRegexWithSpace("^\\> ");
|
||||
static std::regex lineRegexWithSpace(R"(^\> )");
|
||||
line = std::regex_replace(line, lineRegexWithSpace, "");
|
||||
static std::regex lineRegexWithoutSpace("^\\>");
|
||||
static std::regex lineRegexWithoutSpace(R"(^\>)");
|
||||
line = std::regex_replace(line, lineRegexWithoutSpace, "");
|
||||
|
||||
if (!line.empty())
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
void
|
||||
Parse(std::string& line) override
|
||||
{
|
||||
static std::regex re("(?!.*`.*|.*<code>.*)\\~\\~(?!.*`.*|.*<\\/code>.*)([^\\~]*)\\~\\~(?!.*`.*|.*<\\/code>.*)");
|
||||
static std::regex re(R"((?!.*`.*|.*<code>.*)\~\~(?!.*`.*|.*<\/code>.*)([^\~]*)\~\~(?!.*`.*|.*<\/code>.*))");
|
||||
static std::string replacement = "<s>$1</s>";
|
||||
|
||||
line = std::regex_replace(line, re, replacement);
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
{
|
||||
static std::vector<std::regex> res
|
||||
{
|
||||
std::regex{"(?!.*`.*|.*<code>.*)\\*\\*(?!.*`.*|.*<\\/code>.*)([^\\*\\*]*)\\*\\*(?!.*`.*|.*<\\/code>.*)"},
|
||||
std::regex{"(?!.*`.*|.*<code>.*)__(?!.*`.*|.*<\\/code>.*)([^__]*)__(?!.*`.*|.*<\\/code>.*)"}
|
||||
std::regex{R"((?!.*`.*|.*<code>.*)\*\*(?!.*`.*|.*<\/code>.*)([^\*\*]*)\*\*(?!.*`.*|.*<\/code>.*))"},
|
||||
std::regex{R"((?!.*`.*|.*<code>.*)__(?!.*`.*|.*<\/code>.*)([^__]*)__(?!.*`.*|.*<\/code>.*))"}
|
||||
};
|
||||
static std::string replacement = "<strong>$1</strong>";
|
||||
for (const auto& re : res)
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
# This project is licensed under the MIT license. For more information see the
|
||||
# LICENSE file.
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
|
||||
-fuse-ld=gold -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE ld_version)
|
||||
if ("${ld_version}" MATCHES "GNU gold")
|
||||
message(STATUS "Found Gold linker, use faster linker")
|
||||
set(CMAKE_EXE_LINKER_FLAGS
|
||||
"${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS
|
||||
"${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold ")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
@@ -25,4 +40,8 @@ target_include_directories(MaddyTests PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_link_libraries(MaddyTests maddy gmock_main)
|
||||
set_target_properties(MaddyTests PROPERTIES
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -g -Wall -Wpedantic -Wextra -Wno-ignored-qualifiers -fno-rtti -fno-exceptions -fsanitize=address -fno-omit-frame-pointer"
|
||||
)
|
||||
add_test(NAME MaddyTests COMMAND MaddyTests)
|
||||
|
||||
Reference in New Issue
Block a user