Skip to content

Commit

Permalink
Merge branch 'release/5.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher committed Aug 5, 2016
2 parents a578c64 + 4adec66 commit 193c09a
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 20 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# MultiMarkdown Change Log #

## [5.4.0] - 2016-08-05

* ADDED: Add email address to cpack settings (addresses #31)
* ADDED: Move static library options to separate make target
* CHANGED: Increase list of syntax structures that are evaluated for abbreviations (Thanks, David!)
* CHANGED: Update README
* FIXED: Avoids problem mentioned on github (#30), but doesn't actually solve it. Any help appreciated!
* FIXED: Fix crash with empty table label


## [5.3.0] - 2016-06-08 ##

* CHANGED: Update test suite
Expand Down Expand Up @@ -106,3 +116,4 @@
[5.1.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.1.0
[5.2.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.2.0
[5.3.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.3.0
[5.4.0]: https://github.com/fletcher/MultiMarkdown-5/releases/tag/5.4.0
39 changes: 24 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ cmake_minimum_required (VERSION 2.6)
set (My_Project_Title "MultiMarkdown")
set (My_Project_Description "MultiMarkdown - lightweight markup processor")
set (My_Project_Author "Fletcher T. Penney")
set (My_Project_Revised_Date "2016-06-08")
set (My_Project_Revised_Date "2016-08-05")
set (My_Project_Version_Major 5)
set (My_Project_Version_Minor 3)
set (My_Project_Version_Minor 4)
set (My_Project_Version_Patch 0)

set (My_Project_Version "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}")
Expand Down Expand Up @@ -331,24 +331,31 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Some libraries need to be linked on some Linux builds
if (DEFINED TEST)
# target_link_libraries(run_tests m)
else (DEFINE TEST)
# Statically link libraries -- might make the binary slightly more
# compatible across Linux distributions, for example
#
# It will likely cause large numbers of errors on valgrind,
# so use "make debug" for valgrind testing
#
# You may wish to disable this.
#

set (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set (BUILD_SHARED_LIBRARIES OFF)
set (CMAKE_EXE_LINKER_FLAGS "-static")
endif (DEFINED TEST)

endif (WIN32)


# =======================================
# Option to link against static libraries
# =======================================

if (DEFINED STATICBUILD)
# Statically link libraries -- might make the binary slightly more
# compatible across Linux distributions, for example
#
# It will likely cause large numbers of errors on valgrind,
# so use "make debug" for valgrind testing
#
# You may wish to disable this.
#

set (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set (BUILD_SHARED_LIBRARIES OFF)
set (CMAKE_EXE_LINKER_FLAGS "-static")
endif (DEFINED STATICBUILD)


# ==============
# Define targets
# ==============
Expand Down Expand Up @@ -485,6 +492,8 @@ endif (WIN32)

set (CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT})

set (CPACK_PACKAGE_CONTACT "[email protected]")

include (CPack)


Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ release: $(BUILD_DIR) $(GREG)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_BUILD_TYPE=Release ..

# Build release linking to static libraries
.PHONY : static
static: $(BUILD_DIR) $(GREG)
cd $(BUILD_DIR); touch README.html; \
cmake -DCMAKE_BUILD_TYPE=Release -DSTATICBUILD=1 ..

# Build zip file package
.PHONY : zip
zip: $(BUILD_DIR) $(GREG)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
| ---------- | ------------------------- |
| Title: | MultiMarkdown |
| Author: | Fletcher T. Penney |
| Date: | 2016-06-08 |
| Date: | 2016-08-05 |
| Copyright: | Copyright © 2013-2016 Fletcher T. Penney. |
| Version: | 5.3.0 |
| Version: | 5.4.0 |


## Introduction ##
Expand Down
33 changes: 31 additions & 2 deletions src/parser.leg
Original file line number Diff line number Diff line change
Expand Up @@ -1487,9 +1487,15 @@ TableCaption = b:StartList a:StartList (< BracketedText >
( c:AutoLabel { b = c; b->key = TABLELABEL;})? Sp Newline
{
$$ = a;
$$->key = TABLECAPTION;

if ($$ != NULL) {
$$->key = TABLECAPTION;
}

if ( (b != NULL) && (b->key == TABLELABEL) ) {
if ($$ == NULL)
$$ = node(TABLECAPTION);

b->next = $$->children;
$$->children = b;
}
Expand Down Expand Up @@ -1700,7 +1706,30 @@ node * process_raw_blocks(node * n, unsigned long extensions) {
current->key = LIST;
g.data = mk_parser_data(contents, (extensions | EXT_NO_METADATA ));

while (yyparse(&g));
/*
An endless loop was discovered by a user:

https://github.com/fletcher/MultiMarkdown-5/issues/30

It seems that for some reason, a list item consisting only of a "\",
under certain circumstances, generates an endless loop:

1. \

The parser repeatedly asks for yy_input_func, which returns 0. And the
parser then cycles through every possible match over and over and over.

I haven't found the problem, but can institute a failsafe by ensuring that
there is something left in the buffer.

TODO: \todo: Would like to actually fix this, and not just avoid it.
*/

parser_data * d = (parser_data *)g.data;

//while (yyparse(&g));

while ((yyparse(&g)) && (*d->charbuf != '\0'));

current->children = ((parser_data *)g.data)->result;

Expand Down
6 changes: 6 additions & 0 deletions src/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,15 @@ void find_abbreviations(node *list, scratch_pad *scratch) {
case STRONG:
case EMPH:
case TABLE:
case TABLEHEAD:
case TABLEBODY:
case TABLEROW:
case TABLECELL:
case TABLECAPTION:
case DEFLIST:
case DEFINITION:
case TERM:
case IMAGEBLOCK:
/* Check children of these elements */
find_abbreviations(list->children, scratch);
break;
Expand Down
2 changes: 1 addition & 1 deletion tools/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
#ifndef FILE_MULTIMARKDOWN_VERSION_H
#define FILE_MULTIMARKDOWN_VERSION_H

#define MULTIMARKDOWN_VERSION "5.2.0-dep"
#define MULTIMARKDOWN_VERSION "5.4.0-dep"

#endif

0 comments on commit 193c09a

Please sign in to comment.