I am using iTerm2 with italics enabled, and I have the following in my vimrc:
Plugin 'pangloss/vim-javascript' "
Plugin 'mxw/vim-jsx' "
set background=dark
colorscheme one
let g:one_allow_italics = 1
hi htmlArg gui=italic
hi htmlArg cterm=italic
hi Comment gui=italic
hi Comment cterm=italic
hi Type gui=italic
hi Type cterm=italic
Standard html attributes and comments are currently rendering in italics, but React component attributes are not. Has anyone got this working?
Turns out I was using a theme that did not enable italics for React components, switching themes fixed my issue.
Related
I'm a new user of TinyMCE, and i'm trying to incorporate it in my React App. But i'ma actually getting an output problem. When try "format:text" in the tiny component, and try to create a post in my blog using bold and italic options, when the post is posted, the displayed text is just normal, without bold or italic properties. So, I've tried the "format:html" but in this case, I get my text without any styles at all, AND we see the <p> balises.
So, it can looks like a stupid question but, how do we output the posted text correctly ?
As always, thx in advance !
This happened to me as well. If you do not want to see the attributes on your output then go to the React Component which is responsible for output and in your React component when you use the return() keyword you should create a div use the
dangerouslySetInnerHTML attribute inside.
Example:
Here's [a link] (https://blog.logrocket.com/using-dangerouslysetinnerhtml-in-a-react-application/)
I grab content from a CMS via Gatsby. Inside the markup there are placeholders which should be replaced with React elements.
So I get sth like this:
let content = '<span>Hello World [placeholder]!</span>';
and in React I want to change it to sth like this (where the markup for the tooltip comes from a React element):
let content = '<span>Hello World <div class="tooltip">Important warning</div>!</span>';
The final html with the replaced elements should be dumped into the DOM using dangerouslySetInnerHTML.
I tried using react-string-replace:
reactStringReplace(content, '[placeholder]', () => (<Tooltip />));
but it gives me an array containing a mix of strings and React elements that can't be concacenated without breaking the HTML structure.
What would be a good approach to tackle this issue? Or am I wrong using placeholders in the CMS altogether?
i found a really good npm package that provides this functionality and much more: https://interweave.dev/
$scope.barChartData.labels.push(moment(currentDate).format("YYYY-MM-DD") + "
$filter('translate')('To')" + moment(currentDate).add(4, 'days').format("YYYY-MM-DD"));
trying to translate "To" word
Reviewing this 2 lines, i found that you are using lib chart.js
for generating chart in angularjs app. And it create a svg based on data provided. So you need to again reload that svg in html with the same process of creating svg so that it is use translation based on language selection at that time.
Let me know if this solves the issue.
I'm trying to render DRUPAL content type form in a custom tpl that I created. But its just printing the hidden fields not the actual form.
I tried using drupal_get_form and drupal_render, but nothing works!
Can someone suggest me a link or reference to drupal theming guide?
Am I missing something?
You need to use drupal_get_form and drupal_render on 2 different steps.
$myForm = drupal_get_form('YOUR_FORM_ID');
print drupal_render($myForm);
For the Joomla contact form (using Joomla 3.3.3), you have your required fields and a tooltip that shows if you mouse over the field name. Fx. the field "Name" the tooltip I suppose would show "Your name"
But instead it shows this: "< strong >Name< /strong >< br/ >Your name"?
How to remove the "< strong >Name< /strong > "?
Have tried looking around a bit but haven't really found a solution to this yet. Only how to remove/hide the tooltips, but not how to fix it removing those code strings.
Screenshot of my contact form:
https://www.dropbox.com/s/k4dxsst0u91gcan/Contact%20tooltip%20issue.png?dl=0
Okay figured that the problem is coming from my template.
Tried switching over to the joomla protostart template and test it there, and the tooltip work fine.
So now I need to figure out why it isn't working on the template I'm currently using.
It was a jquery conflict with joomla updates.
Fixed it by editing the var.php in my template with the following changes:
From, (line 7):
JHTML::_('behavior.framework', true);
// disabled sins joomla 3
//JHTML::_( 'behavior.mootools' );
To:
JHtml::_('bootstrap.framework'); // JOOMLA 3.X (LOADS BOOTSTRAP)
JHtml::_('behavior.framework', true);
$doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/jquery_no_conflict.js', 'text/javascript');
// disabled sins joomla 3
//JHTML::_( 'behavior.mootools' );
And removed this on line 28.
// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');