Skip to content

Commit b8b6108

Browse files
committed
api breaking changes in emoji module
emoji support for docx converter
1 parent 08dfedf commit b8b6108

File tree

965 files changed

+17344
-3651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

965 files changed

+17344
-3651
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ target/
1919
/flexmark-docx-converter/src/test/resources/docx_converter_issues_ast_spec/
2020
/flexmark-docx-converter/src/test/java/com/vladsch/flexmark/docx/converter/ComboDocxUserSpecDisabled.java
2121
/flexmark-docx-converter/src/test/resources/docx_user_ast_spec.md
22+
/FlexmarkJavaAssets/EmojiReference/EmojiList-v11.0.html

.idea/compiler.xml

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/javax_json_1_0_4.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown-history.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/ComboDocxUserSpecDisabled.xml

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/ExtAttributesTestSuite.xml

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/UnicodeEmojiExtract.xml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VERSION.md

Lines changed: 100 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ flexmark-java
77

88
- [To Do](#to-do)
99
- [Docx Converter](#docx-converter)
10-
- [0.30.2](#0302)
10+
- [0.32.0](#0320)
1111
- [0.30.0](#0300)
1212
- [0.28.38](#02838)
1313
- [0.28.36](#02836)
@@ -228,43 +228,99 @@ flexmark-java
228228
<p><a href="video.mp4" target="_blank" rel="noopener noreferrer" title="Download 'Sample Video'">Sample Video</a></p>
229229
</div>
230230
```
231+
231232
* [ ] Multiline Block quote delimiters `>>>`
232233
* [ ] Deleted text markers `{- -}` or `[- -]`
233234
* [ ] Inserted text markers `{+ +}` or `[+ +]`
234-
* [ ] Header ids with emoji shortcuts generate an extra `-` because of two spaces around the emoji shortcut while GitLab only generates a single `-`.
235+
* [ ] Header ids with emoji shortcuts generate an extra `-` because of two spaces around the
236+
emoji shortcut while GitLab only generates a single `-`.
235237
* [ ] Math, inline via ```$``$``` or as fenced code with `math` info string requiring
236238
inclusion of Katex in the rendered HTML page.
237239
* [ ] Graphing via Mermaid as fenced code with `mermaid` info string, via Mermaid inclusion
238240
similar to Math solution above.
239241
240242
&nbsp;</details>
241243
242-
0.30.2
243-
------
244-
245-
* [ ] Add: Emoji option to convert shortcuts to unicode emoji characters.
244+
0.32.0
245+
------
246+
247+
* Fix: HTML Parser:
248+
* image alt text should escape markdown special characters which can affect parsing of image
249+
link text like: `[]`
250+
* convert `<pre><tt>` to indented code
251+
* add attribute extraction
252+
* id : if `FlexmarkHtmlParser.OUTPUT_ATTRIBUTES_ID` is `true`, default `true`
253+
* `FlexmarkHtmlParser.OUTPUT_ATTRIBUTES_NAMES_REGEX` default `""`, if not empty then will
254+
output attributes extension syntax for attribute names that are matched by the regex.
255+
* did not output a line end at start of `<div>`, this tended to splice text in div to previous
256+
element.
257+
258+
* Add: `AttributesExtension.ASSIGN_TEXT_ATTRIBUTES`, default `false`. When `true` attribute
259+
assignment rules to nodes are changed to allow text elements to get attributes. If an
260+
attribute element is spaced from the previous plain text element `some text {attributes}` then
261+
attributes are for the parent of the text. If they are attached to the text element `some
262+
text{attributes}` then they are assigned to the immediately preceding plain text span. Within
263+
an inline element same rules apply: `**bold text {attr}**` are for the strong emphasis span,
264+
while `**bold text{attr}**` will wrap the text between the strong emphasis tags, in a span
265+
with given attributes.
266+
267+
If a plain text span is interrupted by an HTML comment then it is considered as two separate
268+
plain text spans. ie. `some <!---->text{attr}` will result in `some <!----><span
269+
attr>text</span>` rendering.
270+
271+
* **API Change**: removed `EmojiCheatSheet` class to replace with `EmojiShortcuts` which has better
272+
referencing for GitHub shortcuts and unicode chars for all emojis from
273+
[emoji-cross-reference](https://github.com/vsch/emoji-cross-reference)
274+
275+
* Removed: `EmojiExtension.USE_IMAGE_URL`
276+
* Add: `EmojiExtension.USE_SHORTCUT_TYPE`, default `EmojiShortcutType.EMOJI_CHEAT_SHEET`,
277+
select type of shortcuts:
278+
* `EmojiShortcutType.EMOJI_CHEAT_SHEET`
279+
* `EmojiShortcutType.GITHUB`
280+
* `EmojiShortcutType.ANY_EMOJI_CHEAT_SHEET_PREFERRED` use any shortcut from any source. If
281+
image type options is not `UNICODE_ONLY`, will generate links to Emoji Cheat Sheet files
282+
or GitHub URL, with preference given to Emoji Cheat Sheet files.
283+
* `EmojiShortcutType.ANY_GITHUB_PREFERRED` - use any shortcut from any source. If image type
284+
options is not `UNICODE_ONLY`, will generate links to Emoji Cheat Sheet files or GitHub
285+
URL, with preference given to GitHub URL.
286+
* Add: `EmojiExtension.USE_IMAGE_TYPE`, default `EmojiImageType.IMAGE_ONLY`, to select what
287+
type of images are allowed.
288+
* `EmojiImageType.IMAGE_ONLY`, only use image link
289+
* `EmojiImageType.UNICODE_ONLY` convert to unicode and if there is no unicode treat as
290+
invalid emoji shortcut
291+
* `EmojiImageType.UNICODE_FALLBACK_TO_IMAGE` convert to unicode and if no unicode use image.
292+
293+
* Add: Emoji Extension support to DocxRenderer.
294+
* Add: Emoji Cheat Sheet images to resources in DocxRender jar, default configuration will
295+
resolve emoji image files to the files in the jar.
296+
* Add: `DocxRenderer.DOC_EMOJI_IMAGE_VERT_OFFSET`, default `-0.1`, vertical offset of emoji
297+
image as a factor of line height at point of insertion. The final value is rounded to nearest
298+
pt so jumps of 1 pt for small changes of this value can occur.
299+
* Add: `DocxRenderer.DOC_EMOJI_IMAGE_VERT_SIZE`, default `1.05`, size of emoji image as a factor
300+
of line height at point of insertion.
246301
247302
0.30.0
248303
------
249304
250305
* Fix: #198, StringIndexOutOfBoundsException, in `AbbreviationExtension` if abbreviation
251306
definition had an empty abbreviation.
252307
253-
* API Change: Refactoring of Interfaces to allow extensions only providing link resolver, attribute
254-
provider and html id generator to be re-used by the `DocxRenderer` and `HtmlRenderer` without
255-
modifications other than changing the `implemented` extension from
308+
* API Change: Refactoring of Interfaces to allow extensions only providing link resolver,
309+
attribute provider and html id generator to be re-used by the `DocxRenderer` and
310+
`HtmlRenderer` without modifications other than changing the `implemented` extension from
256311
`HtmlRenderer.HtmlRendererExtension` to `RendererExtension`
257312
258-
* `AttributesProviderFactory` pass only `LinkResolverContext` instead
259-
of `NodeRenderingContext` to allow for attribute provider extensions to be re-used with
313+
* `AttributesProviderFactory` pass only `LinkResolverContext` instead of
314+
`NodeRenderingContext` to allow for attribute provider extensions to be re-used with
260315
`DocxRender`
261316
* `HeadIdGenerator` pass only `LinkResolverContext` instead of `NodeRenderingContext` to allow
262317
for header id generator provider extensions to be re-used with `DocxRender`
263318
* new `RendererExtension` with only ability to register html id generator, link resolver and
264319
attribute provider. Such an extension can be used as is with `HtmlRenderer` and
265320
`DocxRenderer`
266321
267-
`RendererExtension.extend(RendererBuilder, String)` method of these gets passed `RendererBuilder` instead of `HtmlRenderer.Builder`
322+
`RendererExtension.extend(RendererBuilder, String)` method of these gets passed
323+
`RendererBuilder` instead of `HtmlRenderer.Builder`
268324
269325
extensions that implement both `RendererExtension` and `HtmlRendererExtension` will have
270326
only have the html renderer extension `extend` method called.
@@ -278,11 +334,11 @@ flexmark-java
278334
the 8 named colors used by Word or it might complain.
279335
280336
* Add: `DocxRenderer.LOCAL_HYPERLINK_MISSING_FORMAT`, default `"Missing target id: #%s"` to
281-
change the tooltip text of the missing hyperlink. `%s` will be replaced with the reference id of
282-
the link.
337+
change the tooltip text of the missing hyperlink. `%s` will be replaced with the reference id
338+
of the link.
283339
284-
* Fix: DocxConverter self referencing ref anchors should be converted to bookmark references in the
285-
docx
340+
* Fix: DocxConverter self referencing ref anchors should be converted to bookmark references in
341+
the docx
286342
287343
* Add: DocxConverter now supports `AttributesExtension` and `EnumeratedReferenceExtension` by
288344
converting id attributes to bookmarks and enumerated reference links to hyperlinks to
@@ -293,7 +349,8 @@ flexmark-java
293349
294350
* Add: Enumerated links now have title set to the text value of the reference.
295351
296-
* Add: DocxConverter options to control heading id generation to resolve anchor refs to document anchors
352+
* Add: DocxConverter options to control heading id generation to resolve anchor refs to document
353+
anchors
297354
* `DocxRenderer.HTML_ID_GENERATOR`, default `HtmlIdGenerator instance`, the id generator to
298355
use for generating heading ids.
299356
@@ -306,11 +363,14 @@ flexmark-java
306363
first heading of the document and any hyperlinks to it.
307364
-->
308365
309-
For convenience these `HtmlRenderer` keys are aliased through `DocxRenderer`, keep in mind
310-
that setting either will affect both keys. For information on these keys see [`HtmlRenderer` options](https://github.com/vsch/flexmark-java/wiki/Extensions#renderer)
311-
* `DocxRenderer.HEADER_ID_GENERATOR_RESOLVE_DUPES`, default `true`,
312-
* `DocxRenderer.HEADER_ID_GENERATOR_TO_DASH_CHARS`, default `" -_"`
313-
* `DocxRenderer.HEADER_ID_GENERATOR_NO_DUPED_DASHES`, default `false`
366+
For convenience these `HtmlRenderer` keys are aliased through `DocxRenderer`, keep in mind that
367+
setting either will affect both keys. For information on these keys see
368+
[`HtmlRenderer` options](https://github.com/vsch/flexmark-java/wiki/Extensions#renderer)
369+
* `DocxRenderer.HEADER_ID_GENERATOR_RESOLVE_DUPES`, default `true`,
370+
371+
* `DocxRenderer.HEADER_ID_GENERATOR_TO_DASH_CHARS`, default `" -_"`
372+
373+
* `DocxRenderer.HEADER_ID_GENERATOR_NO_DUPED_DASHES`, default `false`
314374
315375
* Add: DocxConverter options to re-map standard style names to user defined ones.
316376
* `DocxRenderer.DEFAULT_STYLE`, default "Normal"
@@ -324,21 +384,21 @@ flexmark-java
324384
* `DocxRenderer.TABLE_CONTENTS`, default "TableContents"
325385
* `DocxRenderer.TABLE_HEADING`, default "TableHeading"
326386
* `DocxRenderer.FOOTNOTE_STYLE`, default "Footnote"
387+
327388
<!--
328389
* `DocxRenderer.BULLET_LIST_STYLE`, default "BulletList"
329390
* `DocxRenderer.BLOCK_QUOTE_BULLET_LIST_STYLE`, default "QuotationsBulletList"
330391
* `DocxRenderer.NUMBERED_LIST_STYLE`, default "NumberedList"
331392
* `DocxRenderer.BLOCK_QUOTE_NUMBERED_LIST_STYLE`, default "QuotationsNumberedList"
332393
-->
333-
* `DocxRenderer.BOLD_STYLE`, default "StrongEmphasis"
334-
* `DocxRenderer.ITALIC_STYLE`, default "Emphasis"
335-
* `DocxRenderer.STRIKE_THROUGH_STYLE`, default "Strikethrough"
336-
* `DocxRenderer.SUBSCRIPT_STYLE`, default "Subscript"
337-
* `DocxRenderer.SUPERSCRIPT_STYLE`, default "Superscript"
338-
* `DocxRenderer.INS_STYLE`, default "Underlined"
339-
* `DocxRenderer.INLINE_CODE_STYLE`, default "SourceText"
340-
* `DocxRenderer.HYPERLINK_STYLE`, default "Hyperlink"
341-
394+
* `DocxRenderer.BOLD_STYLE`, default "StrongEmphasis"
395+
* `DocxRenderer.ITALIC_STYLE`, default "Emphasis"
396+
* `DocxRenderer.STRIKE_THROUGH_STYLE`, default "Strikethrough"
397+
* `DocxRenderer.SUBSCRIPT_STYLE`, default "Subscript"
398+
* `DocxRenderer.SUPERSCRIPT_STYLE`, default "Superscript"
399+
* `DocxRenderer.INS_STYLE`, default "Underlined"
400+
* `DocxRenderer.INLINE_CODE_STYLE`, default "SourceText"
401+
* `DocxRenderer.HYPERLINK_STYLE`, default "Hyperlink"
342402
343403
0.28.38
344404
-------
@@ -359,7 +419,7 @@ flexmark-java
359419
360420
* Fix: core node renderer renderLineBreak could cause NPE
361421
362-
* Fix: #193, Support `<math>` tag as a block-forming tag
422+
* Fix: #193, Support `<math>` tag as a block-forming tag
363423
364424
* Add: `Parser.HTML_BLOCK_TAGS` to define the HTML tags treated as HTML block elements, defaults
365425
are: `address`, `article`, `aside`, `base`, `basefont`, `blockquote`, `body`, `caption`,
@@ -444,10 +504,9 @@ flexmark-java
444504
-------
445505
446506
* Fix: #180, Formatter vs HtmlRenderer
447-
* Formatter ignored `Parser.LISTS_CODE_INDENT` and
448-
`Parser.LISTS_ITEM_INDENT` settings when rendering markdown from AST and used default of 4
449-
spaces for code indent and 4 spaces for list item indent if parser family for formatter was
450-
`FIXED_INDENT`.
507+
* Formatter ignored `Parser.LISTS_CODE_INDENT` and `Parser.LISTS_ITEM_INDENT` settings when
508+
rendering markdown from AST and used default of 4 spaces for code indent and 4 spaces for
509+
list item indent if parser family for formatter was `FIXED_INDENT`.
451510
* Formatter did not force a blank line before a non-item paragraph, assuming it was already
452511
there
453512
@@ -457,7 +516,7 @@ flexmark-java
457516
* Fix: #178, `AutolinkExtension` does not add `http://` to simple urls starting with `www.`
458517
459518
* Fix: #176, docx converter creates a single long bullet list instead of starting a new list
460-
when top level list items are interrupted.
519+
when top level list items are interrupted.
461520
462521
0.28.12
463522
-------
@@ -501,7 +560,7 @@ flexmark-java
501560
only parent's left indent is added to child's left indent.
502561
503562
* Implement DOCX conversion for missing elements:
504-
* Footnotes
563+
* Footnotes
505564
506565
0.28.2
507566
------
@@ -527,9 +586,9 @@ flexmark-java
527586
When true then a delimiter occurrence is not an opener or closer will be skipped.
528587
529588
* Fix: #168, Text with colons is incorrectly interpreted as an invalid emoji shortcut. Now
530-
invalid emoji shortcuts only allow characters which can make up a valid shortcut:
531-
`[a-z0-9_+-]` and if the `:` is not preceded or followed by a digit. The latter eliminates
532-
time strings as erroneously interpreted as an invalid emoji shortcut.
589+
invalid emoji shortcuts only allow characters which can make up a valid shortcut:
590+
`[a-z0-9_+-]` and if the `:` is not preceded or followed by a digit. The latter eliminates
591+
time strings as erroneously interpreted as an invalid emoji shortcut.
533592
534593
* Fix: #163, BasedSequenceImpl.prefix seems broken. Unable to handle zero length string as
535594
other. Add tests for this function

assets/Docx4j_GettingStarted.pdf

1.36 MB
Binary file not shown.

0 commit comments

Comments
 (0)