How to prevent CKEditor from changing tag order - ckeditor

CKEditor transforms the following code :
<h3>H3
<ul>
<li>el 1</li>
<li>el 2</li>
</ul></h3>
to
<h3>H3 </h3>
<ul>
<li>el 1</li>
<li>el 2</li>
</ul>
Is there a way to prevent this behavior?

TL;DR; no
CKEditor is an HTML4/xHTML editor and is based on DTD, which gives a complete set of rules regarding which tags are available and where/how they can appear inside the DOM.
If you will check the DTD you can see that H3 is a heading tag (which is a block) that can have only inline tags inside.
<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
....
<!ENTITY % block
"p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table">
....
<!ELEMENT h3 %Inline;>
<!ATTLIST h3
%attrs;
%TextAlign;
>
The ul tag is also a block tag, so it can't appear inside h3 tag:
<!ENTITY % lists "ul | ol | dl | menu | dir">
....
<!ENTITY % block
"p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table">

Related

Angular 2 Template Form

I have a template-driven Login form and below/outside my form there is a button for "forgot password".
Whenever I click on the "forgot password" button, it first validates my form then at the next click, it navigates.
{{'userNameRequired' | translate}}
{{'userName should between 8-15 letters and contain alphabet, digits and special character like _ , -, . ' | translate}}
{{'passwordRequired' | translate}}
{{'Password must be of a Capital Letter, alphabets and special character like # and _' | translate}}
{{'login' | translate}}
<p style="text-align: center; ">
<a [routerLink]="/forgotpassword">Forgot Password</a>
</p>

Laravel blade template not rendering table properly

I'm quite new to Laravel, but have recently taken over a project from someone and trying to get the mail blade templates to render but I am having problems.
The code used for the enquiry email template is as follows:
#component('mail::message')
#New customer enquiry
We have received a new customer enquiry.
#component('mail::table')
| **Name** | **Email** | **Telephone** |
| ---------------------------------------------- |:---------------------:| -----------------------:|
| {{$enquiry->firstname}} {{$enquiry->lastname}} | <{{$enquiry->email}}> | {{$enquiry->telephone}} |
#endcomponent
Thanks,<br>
{{ config('app.name') }}
#endcomponent
But the table always renders as raw HTML, here is a screenshot of how the email looks in MailCatcher:
I've checked a couple of other posts that concern this kind of issue but usually it's due to the attempt to render more than one table in a mail template, but this is just a single table. Is there a component I have missed or is it just MailCatcher not rendering correctly?
When using Markdown to render emails, avoid using indents excessively. Your code should look like this
#component('mail::message')
#New customer enquiry
We have received a new customer enquiry.
#component('mail::table')
| **Name** | **Email** | **Telephone** |
| ---------------------------------------------- |:---------------------:| -----------------------:|
| {{$enquiry->firstname}} {{$enquiry->lastname}} | <{{$enquiry->email}}> | {{$enquiry->telephone}} |
#endcomponent
Thanks,<br>
{{ config('app.name') }}
#endcomponent
You didn't show how the html which is not being rendered is being loaded.
But it's possible you need to use {!! !!} instead of {{ }} for the variables that contain html.

Footnotes inside a grid_table in pandoc

I am rendering markdown through pandoc+pdflatex. I'd like to have footnote marks inside of a table (grid_table), with footnote text appearing in the bottom of the page. I did:
+-----------------+-------+---------+
|property | A | B |
+=================+=======+=========+
|a | x | y[^1] |
+-----------------+-------+---------+
[^1]: blah blah
But what I got instead was the footnote being rendered inside the cell of the table. How do I get (expected, I think) behavior, where the footnote is being rendered at the bottom of the page?

Wordpress image and link in header

I have a Wordpress child theme of TwentyTwelve with a header image and I would like to place another smaller image with a hyperlink centered in the header image.
---------------------------------------------------------------------
| 1 |
| ----- ----- |
| | 2 | | 3 | |
| ----- ----- |
| |
---------------------------------------------------------------------
From the diagram above, I have [1] being the link to the main site (standard from twentytwelve) and I would like to add [2] and [3] as images and hyperlinks. Any suggestions on how I would to this? I'm just starting to learn theming. Thanks in advance!
I've found a solution if anyone else is looking to do this. In my header.php, I added this just before </header>:
<div style="position:relative; visibility:show; left: 50%; top: -<?php echo get_custom_header()->height/2; ?>px; z-index:2; >
<img src="image" ><br>
</div>

XML xpath, get the parent element till a specific element

I'm looking for the right xpath syntax to get a specific parent of an element.
Example:
root
|- div
| |
| |----??? ---|
| | |-a [class=1]
| | |- text[ A TEXT I DON'T WANT]
| |
| |
| |
| |-text[THE TEXT]
|
|-div
| |-text[THE TEXT I DON'T WANT]
|
|-div
| |-text[THE TEXT I DON'T WANT]
I want to get the text "THE TEXT" but the one that contains a [class=1] inside the same div. Something like this:
//div//a[#class=1]/text[contains(.,'A TEXT')]/parent::*/parent::*.... <till div element> /text
Given the XML
<?xml version="1.0"?>
<root>
<foo id="id1">
<foo id="i2">
<baz/>
</foo>
</foo>
</root>
You can find the nearest ancestor foo element from baz using the XPath expression:
//baz/ancestor::foo[1]
Which will select the foo element node of id "i2".
So in your example (if I understand right) once you have got the "a" element you want, you can get "back up" the tree to the nearest ancestor div by appending "/ancestor::div[1]" to your expression.
Use:
/root/div[.//a[#class='1']]/text()
This selects any text node that is a child of any a element that has a class attribute with value '1' and that (the a element) is a descendent of any div element that is a child of the top element named root.

Resources