@Signature public PMarkdownOptions addEmojiExtension(@Arg(type = HintType.ARRAY) @Optional("null") Memory options) { parserExtensions.add(EmojiExtension.create()); Memory imageType = options.valueOfIndex("imageType"); if (!imageType.isNull()) { this.options.set(EmojiExtension.USE_IMAGE_TYPE, EmojiImageType.valueOf(imageType.toString())); } Memory shortcutType = options.valueOfIndex("shortcutType"); if (!shortcutType.isNull()) { this.options.set(EmojiExtension.USE_SHORTCUT_TYPE, EmojiShortcutType.valueOf(shortcutType.toString())); } Memory imagePath = options.valueOfIndex("imagePath"); if (!shortcutType.isNull()) { this.options.set(EmojiExtension.ROOT_IMAGE_PATH, imagePath.toString()); } Memory imageClass = options.valueOfIndex("imageClass"); if (!shortcutType.isNull()) { this.options.set(EmojiExtension.ATTR_IMAGE_CLASS, imageClass.toString()); } Memory imageSize = options.valueOfIndex("imageSize"); if (!shortcutType.isNull()) { this.options.set(EmojiExtension.ATTR_IMAGE_SIZE, imageSize.toString()); } return this; }
private static MutableDataHolder getMarkdownOptions() { return new MutableDataSet() .set(HtmlRenderer.ESCAPE_HTML, true) .set(EmojiExtension.USE_SHORTCUT_TYPE, EmojiShortcutType.ANY_GITHUB_PREFERRED) // for full GFM table compatibility add the following table extension options: .set(TablesExtension.COLUMN_SPANS, false) .set(TablesExtension.APPEND_MISSING_COLUMNS, true) .set(TablesExtension.DISCARD_EXTRA_COLUMNS, true) .set(TablesExtension.HEADER_SEPARATOR_COLUMN_MATCH, true) .set(Parser.EXTENSIONS, Arrays.asList(TablesExtension.create(), EmojiExtension.create(), StrikethroughExtension.create(), TaskListExtension.create())); }