<blockquote> tags in iTextSharp pdf - itext

I am converting HTML to List using XMLWorker, the indentation (using blockquote tags) not appears in pdf. I have tried creating List with HTMLWorker but the result is same. Is there any way to preserve indentation (when using blockquote tag in HTML for indentation) in pdf?

The blockquote and li do not have indentation to "preserve", its just that almost every browser (if not all) choose to indent them by default. This is an individual choice made by every browser vendor, just as Netscape choose to use grey as the default body background color in the 90's. Any text formatting that you see iText doing is its own "default style" and anything that differs from your expectations you'll need to manually change.
When I try to run a blockquote through the XMLWorker version 5.4.0 I don't see anything and its not on the list of supported HTML tags. Do you have it further wrapped in a SPAN or some other tag? Can you post a sample?
When I run an OL/LI combination through 5.4.0 I see that iText makes them indented. Can you post a sample that doesn't indent? One quick fix would be to apply a simple margin to the UL/OL such <ol style="margin-left:100px;">

Related

TinyMCE 6.0 forced root block option

I understand option forced_root_block will be removed from TinyMCE version 6.0. I use this option to avoid paragraphs (generate br tags instead of p tags).
forced_root_block : false
How am I supposed to avoid white lines in the forthcoming version of TinyMCE?
There's a big discussion about this on GitHub:
https://github.com/tinymce/tinymce/discussions/7342
CSS margin is our recommended way to remove whitespace between paragraphs, but we have logged a ticket to look at how we can address the need for br tags:
https://github.com/tinymce/tinymce/discussions/7342#discussioncomment-2129636
I am not sure if this feature was already there at the time of this question but the newline behaviour option is the solution for me:
newline behaviour: "linebreak"
I wonder where this long time resistance against the br tag by the developer of TinyMCE comes from, because no one wants a new paragraph when using just one enter. Or having br replaced with paragraphs when you paste text from Notepad. Two br tags is another thing. In my scenario I convert two br tags into paragraphs after editing, to be able to style the white line height. Perhaps this approach does not fit in the philosophy of TinyMCE, where HTML inside and outside the editor should be seamless the same.

VS Code - HTML tag wrapping issue

Is there a way to make VS Code stop breaking HTML tags before > on a new line? As you can see on the picture the tag is breaking/wrapping on a next line just after the > . I'm Using Prettier - Code formatter.
You could try adding this line to your settings.json file
{
"html.format.wrapAttributes": "force-aligned"
}
I know this is old, but for those who have the same problem, have you checked to ensure that your document is being treated as HTML rather than something else? I've seen this happen when I format my HTML code in a Javascript document.
On the bottom-right of the VS Code window, after Tab Size, UTF-8, and CRLF (your options may be different) you should see HTML. If you see Javascript, CSS, or some other code language, you'll need to click it and change it to HTML.

vscode: Is it possible to show an image inside a text buffer?

e.g. I write a markdown document and include a line like [myimage](/mypath.jpg) to see the image in a big size above or below this line.
When I'm writing markdown I regularly have to look at an embedded file. At the moment I have to use a split layout and switch my attention between the text buffer and the preview. That's slowing me down and distracting.
What I mean is a full size preview that can fill the whole width of the buffer and is permanently shown. This is offered by the emacs markdown-mode (see this image with a command named "markdown-toggle-inline-images".). This is also available in sublime text e.g. via an add-on named sublime_zk. This is possible in atom with add-ons like preview-inline or inline markdown images.
This would allow to use VSCode like a WYSIWYG md-editor like typora but with all the benefits of using your daily edtior. This should also be interesting for programmers - at least on hackernews typora is regularly praised as the best markdown editor (see e.g. here)
I didn't see an addon for this. Something related was discussed about two years ago in issue 7689 - but this only concerns a mini preview in the gutter or if you move the mouse over a link. For this there is already the add-on Image preview.
This is not possible as of VS Code 1.29. The VS Code api does not provide a way to insert custom elements like images into the editor.
The two closest existing APIs:
The code lens api: CodeLensProvider. These allow you to insert additional clickable commands into an editor (such as displaying a reference count above a function) but these can only be text buttons
The hover api: HoverProvider. Hovers can contain images since they display markdown content. However they are only displayed when the user hovers over them

How to add a macro to an umbraco page when using the markdown editor

EDIT:
What I really need is an editor that'll allow me to write html directly and allow inserting macros.
I'm using WMD editor in umbraco 7 and need to add a partial view macro to the page.
The editor does not have an insert macro button and if I pasted the following code in the editor, it is not shown in the page. I think the markdown processor removes it from the page ; <umbraco:Macro Alias="YourMacroAlias" \>
How can I add the macro to the page ?
Out of the box, the WMD editor does not support embedding Macros in the same way as the Richtext Editor does. You could raise a feature request at http://issues.umbraco.org and see if they'll add it, or you could take the source of the WMD from the Umbraco source at https://github.com/umbraco/Umbraco-CMS and create your own version of the markdown editor based on it.
The way the Richtext editor does it is that it stores the macro details as a specially formatted bit of markup, and there's some code in the front end that looks for that markup and replaces it with the output of the Macro.
Go to the developer section. Open the Macros.
In your macro there is a checkbox "Use in rich text editor and the grid" and "Render in rich text editor and the grid" check this.
For Using in Rich Text the option must be checked in the Data Type.
In the Developer section there is below Data Types, the Richtext editor data type check umbmacro.
In the Rich Text editor there is a "Insert Macro" Button, the 2 gears icon.
But for a markdown datatype there is no button, no support, An option is invent a tag a replace you tag in the template with somethings else. To come a bit near a macro functionality.
Instead of using Markdown editor for less options, you can disable excess commands for the tinyMce too. Extra tags added by tinyMce can also be disabled, see at end
Firstly there is file in config folder named tinyMceConfig.config. It handles the options in all datatypes using tinyMce. Below is entry for macro
<command>
<umbracoAlias>umbracomacro</umbracoAlias>
<icon>images/editor/insMacro.gif</icon>
<tinyMceCommand value="" userInterface="true" frontendCommand="umbmacro">umbracomacro</tinyMceCommand>
<priority>62</priority>
</command>
Go to
Developer -> DataTypes -> Rich Text Editor
There will be toolbar checkbox list. Select umbmacro from the list and save the data type. You will see the macro on the WYSIWYG editor. Uncheck all unwanted options. Also you can create new datatype say "RTE Lite" using property editor "Rich Text Editor" and use this "RTE Lite" where less options are needed.
Edit: Okay, if you do not like extra p tag added by tinyMce, go to "tiny_mce_src.js" file from your umbraco solution, search for forced_root_block : 'p' and change it to forced_root_block : ''

Creating Code Blocks <code> or <pre> in CKEditor

Is there a plugin to allow users to create <code/> or <pre/> blocks?
If I pass in some html that includes <code> </code> blocks the contents shows up, but with no visual indication that it is different from any other text. Thats inconvenient, but I can't seem to find a way that a user could select a block of code they typed that they want to appear literally and click a button to indicate that.
I'm still pretty new to the CKEditor, but I know Telerik has a pretty graceful implementation of this. (just click the upper right toolbar button titled "Format Code Block").
Does this editor support that? Are their any plugins that add this functionality?
As for pre-elements, there is this plugin by wwalc: http://ckeditor.com/addon/insertpre
It is also available in GitHub: https://github.com/wwalc/insertpre
The only issue is that it hasn't been updated in a while - It officially only supports CKE up to version 4.1 - so there might be some ACF problems at least. You can search for alternatives at http://ckeditor.com/addons/plugins/all using keywords like code and pre, this will always show the most up to date results.
For code blocks you can also use the Text Formats feature - by default it is available in the Standard and Full presets, though you can also add it to your custom build.
When the Format plugin is enabled, it adds the Format drop-down list to your toolbar. Check the Formatted text format - it wraps the active text block with <pre> tags. Note that it works on block-level, so you don't even need to perform any text selection. However, this also means it's not appropriate for inline formatting.
You can also add some custom styling to the Formatted format by adjusting the config.format_pre definition. See the Applying Block-Level Text Formats sample for demos of both the default implementation and custom format definition (scroll down the sample page to get the complete source code for both solutions).
As for inline code formatting, the Styles drop-down list contains the inline Computer Code style that wraps a text selection with <code> tags. Likewise, you can (and actually should) customize the styling that is applied with this feature.
Additionally, for some really fancy code formatting, see the optional Code Snippet plugin. It lets you insert code snippets with syntax highlighting into the editor. These snippets look great (you can also choose a theme that you like) and since they are implemented as widgets, they have all advantages of CKEditor widgets: a code snippet is treated as a single entity inside the editor, you can select it as a whole, delete, change its position with drag&drop etc. See the documentation and sample for more information and examples.