1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
Commit Graph

26 Commits

Author SHA1 Message Date
jeremy@jermolene.com
2d9d2fbc2c Initial commit 2023-02-27 13:41:23 +00:00
Jeremy Ruston
23b4e03cd5
Extend HTML tag parser to maintain an ordered array of attribute names (#6132)
* Extend HTML tag parser to maintain an ordered array of attribute names

* Add some tests for repeated attributes

* Record entire attribute in orderedAttributes array so that we can work with duplicated attributes
2021-10-27 11:35:12 +01:00
Cameron Fischer
4c7dcb83d1
Fix for #3306, inline/block widget glitch (#5452)
* Fix for #3306, inline/block widget glitch

* Just realized we don't need to set lastIndex anymore

* Forgot that parseBlocks doesn't use options
2021-01-29 14:57:30 +00:00
Jermolene
ff6aa0570f Check for dollar sign within HTML element name
Fixes #3091
2018-01-16 22:13:40 +00:00
Jermolene
da298f037d Remove extraneous console.log()
Fixing f97c1226aa
2016-10-12 15:50:43 +01:00
Jermolene
f97c1226aa Prevent HTML parser from mis-recognising email addresses
Email addresses such as `<jeremy@example.com>` were being erroneously
parsed as HTML tags.

Fixes #2604
2016-10-12 13:17:53 +01:00
Jermolene
bf9a87dc0e Fix CR handling by HTML parser
@pmario and @welford - I’m not presenting this as a fix for #717
because I’m still not in a position to reproduce it.

However, I found this during a review of newline handling code, and
would be interested if it is implicated in the problems you are
reporting.
2014-08-03 09:43:22 +01:00
Jermolene
c9c1b0fbb4 Get rid of the tweakParseTreeNode() hack
It’s an embarrassing hangover from a refactoring of the parsing
mechanism last year.
2014-05-14 08:51:08 +01:00
Jermolene
ace57dd205 Refactor utilities out of HTML parser
Some of the functions are useful general purpose parser helpers.
2014-04-17 12:00:32 +01:00
Jermolene
ccefc1b17b Tolerate more whitespace in block elements
Previously the double newlines marking a block mode element couldn’t be
interspersed with whitespace.
2014-04-10 11:05:27 +01:00
Jermolene
75ff9fb6c0 Allow the end of text to be treated as a linebreak for parsing HTML tags 2014-02-22 08:43:03 +00:00
Jermolene
c17844b815 Another fix for the block vs inline handline 2014-02-20 22:43:04 +00:00
Jermolene
06a0d21734 Use double linebreaks to indicate content of a widget or html element should be parsed in block mode
Fixes #82.

The old behaviour was to parse the content of a widget or html element
in block mode if the opening tag was followed by a line break. The new
behaviour requires two line breaks.

This makes it possible to include linebreaks more liberally within
wikitext, although care must still be taken to only use double line
breaks when the block mode behaviour is desired.

The code change here is very simple, just a single line change in
html.js. Most of the other changes are to convert various single line
breaks into double line breaks.
2014-02-20 21:42:31 +00:00
Jeremy Ruston
d5f09a4608 Prevented generation of illegal elements
Previously, text like <-> would try to generate an element with an
illegal name, causing a JS error
2013-10-23 12:36:34 +01:00
Jeremy Ruston
f1a7e433ab Allow widget names to include digits 2013-07-14 23:13:42 +01:00
Jeremy Ruston
b51fb9cfa9 Linting 2013-07-05 22:37:55 +01:00
Jeremy Ruston
12b471b8fb Extend the HTML rendering mechanism to support attributes specified as macro invocations 2013-06-18 15:37:19 +01:00
Jeremy Ruston
18f8b7266e Refactor the HTML element parser
The purpose is to allow attributes to be specified as macro
invocations. For example `<div myattr=<<mymacro param1 param3>>>`. The
parser needed sprucing up in order to copy with the nesting of angle
brackets. The refactoring has been done with an eye on using the same
technique in the filter expression parser (which is pretty messy at the
moment -- it throws exceptions for syntax errors, which is bad). Later
I'm hoping to extend the technique to create a more flexible table
parser.
2013-06-15 15:12:05 +01:00
Jeremy Ruston
4bcebf5bbf Fix HTML element parser to not pass capturing parenthesis in terminating regexp 2013-04-04 14:24:21 +01:00
Jeremy Ruston
c85acd71fe Move the void element list into the main config file 2013-02-03 17:44:28 +00:00
Jeremy Ruston
6d24cedbcc Refactored widget renderers to be hosted within HTML element renderers
This arrangement takes better advantage of the similarities between the
now deleted widget renderer and the element renderer. It also obviates
the need for wrapper elements around every widget.
2013-01-03 16:27:55 +00:00
Jeremy Ruston
61eb585640 Fixed problem with HTML inline parse rule
We were incorrectly eating line breaks after self-closing inline HTML
tags
2012-12-31 18:36:13 +00:00
Jeremy Ruston
7d5c355d9e Make the html parser rule work in block mode as well as inline mode 2012-12-30 17:21:38 +00:00
Jeremy Ruston
300b6cc485 Change widget syntax to $ instead of underscore
eg `<$list>`
2012-12-30 13:55:19 +00:00
Jeremy Ruston
094f8c32ca Finishing moving the parser rules about 2012-12-20 16:41:06 +00:00
Jeremy Ruston
54423e599c Moving the wikiparser rules around 2012-12-20 16:38:33 +00:00