i am trying to add this in source code of my page inside a comment.
However,when i save,the characters change from this http://img.ctrlv.in/5134b28e330fa.jpg
to
http://img.ctrlv.in/5134b28e7a5b0.jpg
i tried encoding the characters,but in vain.They still change.
Is there any trick to prevent them from changing?thanks a lot
No.
You are at the mercy of Blogger's template processor.
Related
Disclaimer: I'm super new to this and know very little about the technical terms. I might just not know what to search for in order to find the answer I need. In that case I would really appreciate someone just pointing me the right way.
Now, the problem/question:
Is there a way to avoid things like this:
<table>
<th>
<tr>One </tr>
<tr>Two</tr>
<tr>Three</tr>
</th>
</table>
displaying as if you typed this
<table><br>
<th><br>
<tr>One </tr><br>
<tr>Two</tr><br>
<tr>Three</tr><br>
</th><br>
</table><br>
because using "enter" in the text-box when writing a post is automatically rendered as a line break. Is there something you can put at the beginning of a post to overwrite/ignore this kind of global "enter = line break" thing for that post? As is, I have to type in tables and other things in this format to make it display correctly:
<table><th><tr>One </tr><tr>Two </tr><tr>Three </tr></th></table>
It gets a little hard to navigate after a while 😅
(I can only use things that can be written directly into a post)
I'd really appreciate any kind of help - even if it is a plain and simple "nope, can't be done" - then I at least know I can stop searching ^^
Thanks!
Newlines in HTML code should not matter (more precisely, they are just whitespaces) and they definitely do not render as newlines "by themselves".
If the newlines in yout HTML render as newlines on your screen, there must be something else in your HTML or CSS code that causes this. For example the <pre> or <code> HTML element or white-space:pre in your CSS. All of these (and a few other ones) instruct the browser that newlines in HTML should render as newlines on the screen.
I'm trying to remove text (with a specific class) from MT:EntryBody. More specifically, I'm trying to remove headers from my summary pages.
On this page, http://www.taconic.com/taconic-insights/microbiome-and-germ-free/, in the middle of the first entry there is text that says "Defining Rodent Health Standards". This makes no sense in the summary (because I'm stripping HTML - obviously). SO I want to just remove this line from the summary. I tried using a tag as well as a CSS hidden class but I can't get this to work properly.
Thoughts?
To clarify, you want to remove this in the entry body?
<h3 class="hidden">Defining Rodent Health Standards</h3>
Then, before stripping HTML, you need to use a regexp to catch and remove those blocs. Then, you can remove HTML.
See https://movabletype.org/documentation/appendices/modifiers/regex-replace.html
The easiest thing you could do is to replace:
<$mt:EntryBody$>
With:
<$mt:EntryBody replace="Defining Rodent Health Standards",""$>
Glad to answer also other questions that you might have!
In VS Code I am having trouble in formatting HTML.
For example, I write a list of tags inline and I press Shift+Alt+F and nothing happens.
I noticed this:
If I write:
<div><span><p></p></span></div>
nothing happens when I do the auto format.
If I write:
<div><div><div></div></div></div>
then it becomes:
<div>
<div>
<div></div>
</div>
</div>
hope this will help you to help me...
We had the same problem in my dev team. Please check or try the following things:
Are the keyboard bindings correct?
Is selected code language HTML?
Have you restarted VS code?
Begin a small piece of the formatting and then try again (for some reason it
thinks its already correct.
There are a certain list of tags that are ignored when auto formatting - these are defined in the setings.json file under
html.format.unformatted":
So go to settings (Command-Comma on a mac) and search for that setting and remove the tags you do want formatting.
The bad news is that it still doesn't format how I think it should - i.e. the isn't indented inside the but it at least puts it on a new line for you!
This is a VS code bug. I installed the 1.17 and it worked very well https://code.visualstudio.com/updates/v1_17
I have tried countless plugins, codyfying HTML with escape keys, and my blood is beginning to boil. Switching between Visual and HTML mode is actually changing my content, ie destroying it!!!
OK, i figured out what to do.
First go into visual mode.
Select Preformatted in the formatting drop down. A little grey box is created.
Inside the grey box, copy and paste your raw HTML.
Save it and switch from visual to HTML views a few times. There should be no mangling.
IT IS ABSOLUTELY CRUCIAL that you paste into visual tab, instead of in the text tab, or it will get stuffed up completely (very unintuitive. You would think it would work the other way araound).
Wordpress does a strange thing where if you switch between visual and "text" mode (HTML mode was renamed in 3.5 update) it strips any tags that appear empty which often times may not be. This might be what you are experiencing if I am understanding the problem correctly.
If you are just trying to display code on your website you should be able to wrap the code like this:
<code><p>Example code post</p></code>
This is laid out in these guidelines here: http://codex.wordpress.org/Writing_Code_in_Your_Posts
If it is a block of code that needs to not wrap you could also use the "pre" tag like so:
<pre><code><p>Example code post</p></code></pre>
This is described very well here: <code> vs <pre> vs <samp> for inline and block code snippets
Yes, it is absolutely possible. You can follow any of the above mentioned methods. I prefer the following way.
First of all, decode the HTML code using online html decoder. You can find any on google. Then, You can paste the decoded code on your post. The benefit of this method is that, your indentation won't be lost.
Decoded Code
Rendered View File
Hope, it helps future reader to find a way.
Wordpress is very buggy. It took me a long time to finally succeed. For my Wordpress.org installed on my pc I tried: go to visual mode, add pre-formatted text block, copy/paste decoded or encoded. I tried :
<pre><code><p>Example code post</p></code></pre>
That did not work.
The only way it works for me is:
Go to visual, instead of adding a pre-formatted text block I create a paragraph text block, copy/paste the encoded HTMl and then convert it to preformat.
Hope that helps.
Perhaps, You should try out this plugin
http://wordpress.org/extend/plugins/insert-html-snippet/
Hope this helps!
One way to do is to make the code commented. Something like,
<!--div>
<md-divider class="org__meta-divider md-soc-theme"></md-divider>
<h4 class="org__meta-heading">Technologies</h4>
<ul layout="" layout-wrap="" class="org__tag-container layout-wrap layout-row">
<li class="organization__tag organization__tag--technology">web services</li>
</ul>
</div-->
instead of
<div>
<md-divider class="org__meta-divider md-soc-theme"></md-divider>
<h4 class="org__meta-heading">Technologies</h4>
<ul layout="" layout-wrap="" class="org__tag-container layout-wrap layout-row">
<li class="organization__tag organization__tag--technology">web services</li>
</ul>
</div>
Yes, I am struggling with displaying data from our database that CONTAINS markup! One particular field I am displaying has an open-bold tag but no close bold tag. I am trying to 'contain' this markup so it doesn't affect the rest of the page.
The data coming from my database is like this text:
this is soem nasty <b>data
(note the lack of a closing < /b > tag)
If I enclose the markup in a div, the rest of the page is bold:
<div>this is some nasty <b>data</div>
However if I wrap it in a table like this:
<table><tr><td>this is some nasty <b>data</td></tr></table>
All is well! In fact, the DOM inspector for both FF (FireBug) and IE9 show the tree. In the div-case, it shows the open-b tag and the rest of the document contained within it. But the table seems to enclose it.
How can I get this to 'close the b' without a table?
You use a closing </b> tag properly, like any sane human being.
You can use DOMDocument and tidy to try and fix the malformed markup in case you have no control over it, but it's best if you could fix it before it got to your database.
I've read somewhere that HTML Purifier should be able to achieve this. Might be worth trying.
I took a cue from HTML rich-text editors like TinyMCE and built up an IFrame. It seems to contain the arbitrary, possibly-mal-formed content better.