orc / discount Goto Github PK
View Code? Open in Web Editor NEWMy C implementation of John Gruber's Markdown markup language
Home Page: http://www.pell.portland.or.us/~orc/Code/discount
License: Other
My C implementation of John Gruber's Markdown markup language
Home Page: http://www.pell.portland.or.us/~orc/Code/discount
License: Other
Currently, the MKD_TOC
option generates headers that look like <h1 id="name">name</h1>
. This is not ideal, since setting arbitrary id
s can unintentionally pull in CSS styles. Instead, using a <a name="name"></a>
before the <h1>
produces the same effect without the side-effect:
diff --git a/generate.c b/generate.c
index 512d354..c148573 100644
--- a/generate.c
+++ b/generate.c
@@ -1312,13 +1312,12 @@ text(MMIOT *f)
static void
printheader(Paragraph *pp, MMIOT *f)
{
- Qprintf(f, "<h%d", pp->hnumber);
if ( f->flags & MKD_TOC ) {
- Qprintf(f, " id=\"", pp->hnumber);
+ Qprintf(f, "<a name=\"");
mkd_string_to_anchor(T(pp->text->text), S(pp->text->text), Qchar, f, 1);
- Qchar('"', f);
+ Qprintf(f, "\"></a>\n");
}
- Qchar('>', f);
+ Qprintf(f, "<h%d>", pp->hnumber);
push(T(pp->text->text), S(pp->text->text), f);
text(f);
Qprintf(f, "</h%d>", pp->hnumber);
I want to produce html to supress "<script>...</script>", I can do this with MKD_NOHTML flag support on mkd_compile(),
But how can I do if I want keep the <embed></embed> flag? I tried MKD_EMBED flag, but not work for this.
The programs generated by AC_CHECK_FUNCS break on OS X with Clang:
looking for the strcasecmp function
ngc5493.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main()
^~~~
ngc5493.c:4:5: warning: implicitly declaring library function 'strcasecmp' with type 'int (const char *, const char *)'
strcasecmp();
^
ngc5493.c:4:5: note: please include the header <strings.h> or explicitly provide a declaration for 'strcasecmp'
ngc5493.c:4:16: error: too few arguments to function call, expected 2, have 0
strcasecmp();
~~~~~~~~~~ ^
2 warnings and 1 error generated.
offending command was:
main()
{
strcasecmp();
}
I think that escaped backticks should be allowed in inline code blocks. For example, see the following:
`\`test\``
Produces:
<code>`test`</code>
2.0.4 needs to be tagged as such for distros to start packaging it.
The docs say different things in different places:
This is kind of confusing.
No other Markdown HTML converters support this, and rightly so, as it involves having CSS output as well as HTML output. I have two proposed implementations. The following is some example markdown with arbitrary-starting point lists.
Adventure Stuff
===============
Wilderness Survival Guide
-------------------------
…
32. Bring a knife.
33. Don't forget your AK!
34. Bring a phone with a solar battery charger.
35. Pack a week's worth of food and water.
Driving Directions to Mt. Doom
------------------------------
…
842. Take a left and drive straight for 1 kilometer.
843. Turn right and continue for 300 meters.
844. You have reached your destination!
Implementation one: Have a common discount-arbitrary-ol
CSS class and assign it to every ordered list element whose first list item is not one. Give each of these ordered lists a unique ID (possibly discount-arbitrary-ol-1
or a random GUID) and set the starting point for them in CSS using counter-reset
. The HTML and CSS output for implementation one is as follows:
HTML output:
<h1>Adventure Stuff</h1>
<h2>Wilderness Survival Guide</h2>
<p>…</p>
<ol class="discount-arbitrary-ol" id="discount-arbitrary-ol-1">
<li>Bring a knife.</li>
<li>Don't forget your AK!</li>
<li>Bring a phone with a solar battery charger.</li>
<li>Pack a week's worth of food and water.</li>
</ol>
<h2>Driving Directions to Mt. Doom</h2>
<p>…</p>
<ol class="discount-arbitrary-ol" id="discount-arbitrary-ol-2">
<li>Take a left and drive straight for 1 kilometer.</li>
<li>Turn right and continue for 300 meters.</li>
<li>You have reached your destination!</li>
</ol>
CSS output:
.discount-arbitrary-ol {
counter-reset: discount-arbitrary-ol-item;
list-style: none;
}
.discount-arbitrary-ol li {
counter-increment: discount-arbitrary-ol-item;
}
.discount-arbitrary-ol li:before {
content: counter(discount-arbitrary-ol-item) ". ";
}
#discount-arbitrary-ol-1 {
counter-reset: discount-arbitrary-ol-item 31;
}
#discount-arbitrary-ol-2 {
counter-reset: discount-arbitrary-ol-item 841;
}
Alternatively, without using CSS, implementation one can be done by using the deprecated start
attribute on ordered list elements.
Implementation two: For every ordered list element whose list items are not an integral sequence starting at one (i.e. any sequence that doesn't start at one or skips numbers), assign the ordered list element a discount-arbitrary-ol
class, and every list item a data-item-number
attribute representing their number. The HTML and CSS output for implementation two is as follows (the numbers of the example markdown lists have been changed to 32, 23, 74, and 95 for the first list, and 142, 543, and 844 for the second)
HTML output:
<h1>Adventure Stuff</h1>
<h2>Wilderness Survival Guide</h2>
<p>…</p>
<ol class="discount-arbitrary-ol">
<li data-item-number="32">Bring a knife.</li>
<li data-item-number="23">Don't forget your AK!</li>
<li data-item-number="74">Bring a phone with a solar battery charger.</li>
<li data-item-number="95">Pack a week's worth of food and water.</li>
</ol>
<h2>Driving Directions to Mt. Doom</h2>
<p>…</p>
<ol class="discount-arbitrary-ol">
<li data-item-number="142">Take a left and drive straight for 1 kilometer.</li>
<li data-item-number="543">Turn right and continue for 300 meters.</li>
<li data-item-number="844">You have reached your destination!</li>
</ol>
CSS output (constant):
.discount-arbitrary-ol {
list-style: none;
}
.discount-arbitrary-ol li:before {
content: attr(data-item-number) ". ";
}
Alternatively, without using CSS, implementation two can be done by using the deprecated value
attribute on list item elements. Consecutive non-skipping list items wouldn't need explicit value
s either.
HTML comments are the only reasonable way to do comments in markdown, so I consider them a core feature that shouldn't ever be disabled. The comments can be stripped from generated HTML. For example, GitHub allows HTML comments and strips them from generated HTML output, just the same as what I have propsed (well they used to not allow them, but now they do).
Markdown Extras supports adding the attribute markdown="1"
to verbatim HTML tags to allow markdown to be used within this HTML tags. While discount covers many use cases for arbitrary HTML with its > %classname%
syntax, there are some situations where this attribute is useful.
foot->flags is not initialized in addfootnote.
generated mkdio.h features int mkd_cleanup(MMIOT_) but implementation file resource.c defines void mkd_cleanup(MMIOT_), resulting in the return value being random.
Additionally, the documentation lacks details about the return value, which may confuse users into thinking that it behaves similary to other mkd functions (returning 0 on success).
Please see the original issue at: davidfstr/rdiscount#74
Please see comment here for the issue in the Discount 2.0.7 build system:
davidfstr/rdiscount#83 (comment)
Additional investigation needs to be done to determine whether the same issue applies to HEAD (or 2.1.5).
When escaped square brackets are present in link text, links do not seem to be created.
Example Markdown input: [a \[b\] c](/d)
Expected HTML output: <a href="/d">a [b] c</a>
Actual HTML output: [a [b] c](/d)
When the table bellow is feed to discount the last column instead of been centered get's right aligned and the middle column that should be right aligned are not.
Left align | Right align | Center align |
---|---|---|
This | This | This |
column | column | column |
will | will | will |
be | be | be |
left | right | center |
aligned | aligned | aligned |
I was wondering if you have any plans for supporting "pure" (non-link) footnotes. I am aware that this is not part of the original Markdown "spec", but you can find these in many extensions. I'd say even John (G) is using some sort of extension for its own blog that supports footnotes.
As far as I can tell the common syntax for footnotes is:
Some text with a footnote[^1] and some more text
[^1]: this is the footnote referenced above
The generated HTML seems to depend from extension to extension. Two of the Python markdown libs are generating something like
<sup><a> for the reference
and a block:
<div>
<ol>
<li>footnote
</ol>
</div>
Any thoughts?
I think it would be great if you added support for some (eventually all) of markdown extra (as created by php-markdown-extra). http://michelf.com/projects/php-markdown/extra
I especially like the header-id and fenced code blocks
I have a problem with PIC when compiling against the discount shared library in 64 bit ubuntu. My compiler informs me that I should recompile with -fPIC
that makes sense, but there's no configure flag switch to do that. So I had to open up the makefile it generated and just add -fPIC to the CC command.
Anyway we could... just make that a configure switch?
I tried to hack it but I quickly became baffled by your configure scripts setup :)
~ Anders
Here's my proposed fix:
Given that markdown image syntax is disabled and image syntax is encountered:
I like the [![GitHub](//github.com/images/modules/header/logo.png) Issues](//github.com/Orc/discount/issues) feature.
), ignore image syntax and convert it as such: I like the [GitHub Issues](//github.com/Orc/discount/issues) feature.
.![GitHub logo](//github.com/images/modules/header/logo.png)
), convert it as such, ignoring the leading exclamation mark: [GitHub logo](//github.com/images/modules/header/logo.png)
.P.S. While submitting this issue, I discovered what is possibly GitHub's planned new logo (current is logov3.png, the following is logov4.png):
Here is a terminal session, where markdown is Discount:
% echo ' <code>\</code> ' | Markdown.pl
<p><code>\</code> </p>
% echo ' <code>\</code> ' | markdown
<p> <code></code></p>
mkd2html.c:84 should be "while ( argc > 1 ) {" otherwise "strcmp(argv[1], ..." causes a segmentation fault
Under MultiMarkdown, this input:
| Column 1 | Column 2 | Column 3 | Column 4 |
| -------- | :------: | -------- | -------- |
| No span | Span across three columns |||
should produce this output:
<table>
<thead>
<tr>
<th> Column 1 </th>
<th align="center"> Column 2 </th>
<th> Column 3 </th>
<th> Column 4 </th>
</tr>
</thead>
<tbody>
<tr>
<td> No span </td>
<td align="center" colspan="3"> Span across three columns </td>
</tr>
</tbody>
</table>
Man, Multi-Markdown tables are crazy complicated, no?
I think that this is the commit that changed the behavior. I don't suppose it would be possible for an option to be added to restore the use of the id
attribute for anchors, would it?
Relatedly, would it be possible to add another option to specify the character to use in place of non-alphanumeric characters in those anchors. I'm fine with the default "." for new sites, but I have existing sites with links to named anchors that still use "+", and I'd like to be able to use the newer version of discount but not have those links break
Thanks!
Currently, discount seems to support only one mention of a labelled footnote; Subsequent footnotes are ignored. Instead, they should point to the footnote/endnote with the same label and the footnote should have multiple links back to all mentions.
Hi,
I've just noticed that if I run ./configure.sh
with the --shared
option, it ignores the --with-*
options:
$ ./configure.sh --with-id-anchor --with-github-tags --with-fenced-code --shared
[...]
$ make
[...]
$ ./markdown -V
markdown: discount 2.1.1.3 DEBUG DL=DISCOUNT
Without --shared
$ ./configure.sh --with-id-anchor --with-github-tags --with-fenced-code
[...]
$ make
[...]
$ ./markdown -V
markdown: discount 2.1.2 DL=DISCOUNT ID-ANCHOR GITHUB-TAGS FENCED-CODE
I did't notice this until I actually tried to use fenced code (after you pointed out that it is supported)
The generated config.h
files seem ok:
With --shared
:
/*
* configuration for markdown, generated dom 2 ott 2011, 16.49.53, CEST
* by ale@PC-Ale
*/
#ifndef __AC_MARKDOWN_D
#define __AC_MARKDOWN_D 1
#define OS_LINUX 1
#define USE_DISCOUNT_DL 1
#define WITH_FENCED_CODE 1
#define WITH_ID_ANCHOR 1
#define WITH_GITHUB_TAGS 1
#define PATH_FIND "/usr/bin/find"
#define DWORD unsigned int
#define WORD unsigned short
#define BYTE unsigned char
#define HAVE_PWD_H 1
#define HAVE_GETPWUID 1
#define HAVE_SRANDOM 1
#define INITRNG(x) srandom((unsigned int)x)
#define HAVE_BZERO 1
#define HAVE_RANDOM 1
#define COINTOSS() (random()&1)
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_FCHDIR 1
#define TABSTOP 4
#define HAVE_MALLOC_H 1
#define PATH_SED "/bin/sed"
#endif/* __AC_MARKDOWN_D */
Without:
/*
* configuration for markdown, generated dom 2 ott 2011, 16.50.15, CEST
* by ale@PC-Ale
*/
#ifndef __AC_MARKDOWN_D
#define __AC_MARKDOWN_D 1
#define OS_LINUX 1
#define USE_DISCOUNT_DL 1
#define WITH_FENCED_CODE 1
#define WITH_ID_ANCHOR 1
#define WITH_GITHUB_TAGS 1
#define DWORD unsigned int
#define WORD unsigned short
#define BYTE unsigned char
#define HAVE_PWD_H 1
#define HAVE_GETPWUID 1
#define HAVE_SRANDOM 1
#define INITRNG(x) srandom((unsigned int)x)
#define HAVE_BZERO 1
#define HAVE_RANDOM 1
#define COINTOSS() (random()&1)
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_FCHDIR 1
#define TABSTOP 4
#define HAVE_MALLOC_H 1
#define PATH_FIND "/usr/bin/find"
#define PATH_SED "/bin/sed"
#endif/* __AC_MARKDOWN_D */
Is this normal? Am I doing something wrong?
Unless I'm mistaken void elements in Discount are closed in XHTML style (e.g., <img />
rather than <img>
). Maybe I shouldn't care, but I prefer the HTML style and I would like to be able to get it in Discount.
Ideally it would be nice to be able to flip between >
closings and />
at runtime, but at the moment, I'm just tinkering with a configuration (one-time) switch. (Perhaps a default of XHTML style, but --enable-HTML
or the like for the alternative choice.) The tags I see that are relevant are <hr>
, <img>
(both in generate.c) and <link>
in mkd2html.c.
Some questions:
Thanks.
Do you think it would be possible to support some or all the pandoc's markdown extensions (maybe not by default)?
See Pandoc's markdown for reference (the extensions are "marked" with Pandoc extension
).
Thanks
There is a project that uses discount called rdiscount - https://github.com/rtomayko/rdiscount/
It uses your lib through Ruby. However there is this issue with support for HTML5 tags. Currently HTML5 tags like
are wrapped intags. There is already an issue open for this on rdiscount: https://github.com/rtomayko/rdiscount/issues#issue/21
However I was able to track the issue to discount sources ( https://github.com/rtomayko/rdiscount/issues#issue/21/comment/714629 ).
I was wondering if this feature/support should be introduced here itself. If you could give me a little guidance as to how to go about this feature -- like whether html5 support should be optional or exposed through an option -- I would be willing to work on a patch for this.
Writing a list of items, I had:
- A
-
With the second part blank for when I figured out what I wanted to put there. To my surprise, it interpreted this as equivalent to:
- A
---------------
In other words, a <h2>
heading.
My question is whether you should need at least two dashes to set off that behavior. markdown.pl
exhibits this same behavior, so I guess this is according to spec. Still, I don’t really like it. It seems too surprising.
The static analyzer picked up some issues, here is a patch that fixes them:
I'm not sure why I'm getting this error, but confgure.sh is not successful...
$ ./configure.sh
Configuring for [markdown]
Looking for cpp (/lib/cpp) ok
looking for install (/usr/bin/install)
checking the C compiler (cc) oh ick, it looks like gcc
looking for ar (/usr/bin/ar)
looking for ranlib (/usr/bin/ranlib)
checking for "volatile" keyword (found)
checking for "const" keyword (found)
defining WORD & DWORD scalar types ** FAILED **
While playing around, I noticed that I would sometimes get garbage at the end of my string:
#include <mkdio.h>
#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
char *buf, *s = "lol <script>alert('hello, *world*')</script> lol";
MMIOT *doc = mkd_string(s, strlen(s), 0);
mkd_compile(doc, MKD_NOHTML);
mkd_document(doc, &buf);
printf("%s\n", buf);
mkd_cleanup(doc);
return 0;
}
produces <p>lol <script>alert(‘hello, <em>world</em>’)</script> lol</p>Áð
- note the final characters. This bug is kind of hard to isolate; it disappears if I put the MKD_NOHTML flag in the mkd_string function, or if I change a couple characters in the input string. Maybe I'm just doing something wrong with the pointers (I don't actually know C).
Support of class extension to code blocks like as in GFM is very valuable option.
Would you mind adding it?
If Markdown has more closing backticks than opening, characters will get eaten.
"test``" or "``test```" will yield "<code>est</code>". Similarly, "
test```" will produce "<code>st</code>"
I am looking to add, for my own use for now (doubt many other people want/need this, but if they do then great!) a rule to make discount output closer to github-flavored-markdown (GFM).
In particular, GFM does 3 things.
They are:
Discount already handles the last case beautifully, and the git hash extraction is fairly git specific, so only the first element is really interesting to me right now. I find the change makes markdown a bit more straightforward with regard to formatting, and in some cases Gruber agrees.
In ruby, github is currently using this code snippet here at line 17:
# in very clear cases, let newlines become <br /> tags
text.gsub!(/^[\w\<][^\n]*\n+/) do |x|
x =~ /\n{2}/ ? x : (x.strip!; x << " \n")
end
It appears to be (if my regex parsing is correct) checking for lines that start with a word char, or a <, and end in a newline. If that case matches, then a check is made to see if the next char of the next line is a newline. If not (next line stars with a non-newline char), then it removes the newline and adds two space to the line then appending the newline. This is a pre-pass, so markdown will see the spaces at the end of the line and insert a <br>
. This should be a simpler test in the actual markdown parser, if a newline is found, and the next char of the next line is not a newline, then insert a break.
I would think a flag (new flag bit as described on http://www.pell.portland.or.us/~orc/Code/discount/) would make sense so people can enable/disable it as they see fit, especially due to the fact that this modifies markdown behavior and would be unexpected to people looking for full markdown conformance.
I am having a bit of a hard time figuring out the parsing in generate.c though (my C is pretty rusty and was arguably never that great). It seems to me that here is an appropriate place to check for the conditions noted above, but I am confused by the ascii ETX case test. Is there a step before that performing a substitution on newline chars to ETX chars for the sake of not confusing the parser when adding newlines via transformations?
Hi,
Can you check make install
failed issue?
Check the generated Makefile
, I notice $(DESTDIR)
is undefined, so it has big problem with below lines:
install: $(PGMS) $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(LIBDIR) $(DESTDIR)/$(INCDIR)
/usr/bin/install -s -m 755 $(PGMS) $(DESTDIR)/$(BINDIR)
./librarian.sh install libmarkdown VERSION $(DESTDIR)/$(LIBDIR)
/usr/bin/install -m 444 mkdio.h $(DESTDIR)/$(INCDIR)
Thanks,
Kuaf
Hi David,
I'm trying to debug discount for fully understanding design principle. I prefer gdb debug with pipe input, since I want to dig into more from simple unit test, e.g. sh ./tests/header.t. Actually below is testing procedure:
$ echo "#" |./markdown
<p>#</p>
So with gdb tool, I must do (refer to http://stackoverflow.com/questions/8422259/gdb-debugging-with-piped-input-not-arguments):
echo "#" > test_header_file1.txt
gdb ./markdown
b main.c:main
run < test_header_file1.txt
The issue was it did not work as you image, and exit program in below code:
163 if ( argc && !freopen(argv[0], "r", stdin) ) {
164 perror(argv[0]);
165 exit(1);
166 }
Can you reproduce this issue on your box?
Note: I change main.o, pgm_options.o with -g.
thanks and regards,
njman
If there is a link in a heading and one generates a toc, discount will crash in generate.c / printlinkyref.
The reason is probably a not fully initialized MMIOT, since printlinkyref is accessing f->cb and this is NULL.
Cheers, richi
Hi David
I was trying to pull in discount as a submodule for a couple of OS X projects but the project no longer builds.
See the following commit 07c1092
/* the standard collection of tags are built and sorted when
10 * discount is configured, so all we need to do is pull them
11 * in and use them.
12 *
13 * Additional tags still need to be allocated, sorted, and deallocated.
14 */
15 #include "blocktags"
blocktags doesn't seem to be in in the repository.
Thanks
Jonathan
Please add triple backtick as fencing method like GitHub Flavored Markdown (like Pandoc triple tilde).
Additionally, it woul be more awesome if the word after the triple backtick (for example '''ruby) will be treated as class for marking language. (I replaced backticks with apos to prevent GH eat it).
When running under valgrind I've noticed is_extra_dt() issues an invalid read of size 1.
This apparently fixes it, though I confess I haven't looked closely
cataphract/php-discount@bf6c7fd
Here’s a test case:
<!-- 1\. --> Paragraph one.
<!--2\.--> Paragraph two.
Expected output: P1 and P2 should be treated the same way. Probably, both of them should be wrapped in <p>
s.
Actual output:
<!-- 1\. --> Paragraph one.
<p><!--2\.--> Paragraph two.</p>
(As for why anyone would generate this input, I was translating a document and numbering paragraphs to help keep track of where I was. For the final output, I tried to just wrap the numbers in <!-- -->
s to keep it out of the display version.)
Discount already supports creating <span>
s and <div>
s with the class:
etc. formatting of markdown links. Why not also support the lang
attribute? Proposed usage:
Input:
[Hello][en] & [こんにちは][jp]
[en]: lang:en
[jp]: lang:jp
Output:
<p><span lang="en">Hello</span> & <span lang="jp">こんにちは</span></p>
It would be handy for me at least.
Currently, it seems to be impossible to write markdown with two adjacent > %classname%
blocks.
> %classname%
> content for first block
> %classname%
> content for second block
results in
<div class="classname"><p>content for first block</p>
<p>%classname%
content for second block</p></div>
Is there a workaround to achieve this without inserting visible markup/text between the blocks?
Given the following input:
<span>foo</span><br>
<br>
<span>bar</span><br>
discount
outputs:
<p><span>foo</span><br></p>
<br>
<p><span>bar</span><br></p>
but other Markdown engines (such as Text::Markdown
, sundown
and the original Markdown.pl
script) output:
<p><span>foo</span><br>
<br>
<span>bar</span><br></p>
pandoc
outputs:
<p><span>foo</span><br> <br> <span>bar</span><br></p>
etc...
Would it be possible to align the discount behavior to the one of the Markdown.pl
script (and the other engines)?
This was originally reported as Debian bug #656122.
I'm new to using both github and markdown, so I apologize in advance if this has already been fixed/answered.
When building a project in Xcode that includes markdown, all the uses of the CREATE(x) macro have the warning message "cast to pointer from integer of different size". I tried Googling it to find a fix, but all I can find out is that it's related to 64 bit (I'm running Snow Leopard).
The project is a fork of markdownlive: https://github.com/rentzsch/markdownlive/
The warnings happen in the both the original project's 1.5.4 version and in the latest version of markdown I tested
The following input (with two trailing spaces on the first line):
"one"
two
Is producing this output:
<p>“one"<br/>
two</p>
The expected output is:
<p>“one”<br/>
two</p>
For some reason the double trailing spaces are tripping up the smart quotes conversion.
I don't actually think this is a bug, but I wanted to verify that this change in behavior is expected.
Input:
# Level 1
## Level 2
TOC output in Discount 2.0.7:
<ul>
<li><a href="#Level.1">Level 1</a></li>
<li><ul>
<li><a href="#Level.2">Level 2</a></li>
</ul></li>
</ul>
TOC output in Discount 2.1.6:
<ul>
<li><a href="#Level.1">Level 1</a>
<ul>
<li><a href="#Level.2">Level 2</a></li>
</ul>
</li>
</ul>
Both of the above outputs pass W3C HTML validation.
The release notes for Discount 2.1.3 indicate what appears to be the behavior change demonstrated above:
The table of contents code was apparently generating bad html (something I never noticed, because I never use that feature, alas!) but Stefano D'Angelo contributed a patch to clean up the generated html to make it correct.
Could you confirm that this change in output is expected?
node-discount, a javascript binding of discount, fails to install with this error message:
/usr/bin/ld: /usr/local/lib/libmarkdown.a(mkdio.o): relocation R_X86_64_32 against `fgetc' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmarkdown.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
this comment fixes it by forcing position independent code:
Patch "Makefile.in" in your "discount" build tree, with this diff :
1c1
< CC=@CC@ -I. -L. -fPIC
---
> CC=@CC@ -I. -L.
sorry I couldn't make a clean example, but I don't really understand any of this.
Hello,
The MKD_NO_EXT
flag name is not consistent with the other "no" flags, which do not have an underscore after the MKD_NO
. Please either (1) remove the underscore after the MKD_NO
in MKD_NO_EXT
or (2) add an underscore after the MKD_NO
in all other "no" flags. 👮
Thanks for your consideration.
Per http://michelf.com/projects/php-markdown/extra/#table this input:
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
should produce this output:
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
</tr>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
</tr>
</tbody>
</table>
Instead it produces the following:
<table>
<thead>
<tr>
<th></th>
<th> First Header </th>
<th> Second Header </th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td> Content Cell </td>
<td> Content Cell |</td>
</tr>
<tr>
<td></td>
<td> Content Cell </td>
<td> Content Cell |</td>
</tr>
</tbody>
</table>
Notice that it has empty <th>
/<td>
cells at the start and an extraneous |
left over at the end of the content cell.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.