how to get the text-underline from strapi articles to my gatsby frontend
Have you tried using your own rendering component (components
)?
<ReactMarkdown
children={content}
components={{
u: ({node, ...props}) => <u style={{textDecoration: 'underline'}} {...props} />
}}
className={s.content}
transformImageUri={uri => uri.startsWith("http") ? uri : `${process.env.GATSBY_IMAGE_BASE_URL}${uri}`}
/>
More details about components property: https://github.com/remarkjs/react-markdown#appendix-b-components
You can even use a custom-styled <p>
instead of <u>
if needed. The idea relies on parsing the <u>
tag to add your own underlined component.
Apparently, it is needed to install rehype-raw
plugin to allow ReactMarkdown
to understand and interpret underlined tags (<u>
)
Can we put underline in single line text field of contentful?
/p>
When you're using the Markdown editor the problem the problem is not with Contentful but rather the markdown specs themselves. They do not provide the "underline" functionality.
The question about underline is a common question. The idea of markdown is to only care about content and not really the representation (e.g. "bold" translates to the html strong
element which stands syntactically for important parts) though.
IMO underlined text can also be confused with links too easily.
If you have to make this work you can either bring in inline HTML (has the downside that you'll loose cross-platform compatibility because not every system can deal with HTML) or you handle the underline functionality in your application consuming Contentful with some CSS for example.
E.g. assuming that you want to highlight something in your application/website I could see that the "bold"/"strong" meaning could work for you.
Overall rule of thumb with markdown is thinking of the document structure and content rather then it's appearance. "These are important words in this paragraph" () vs. "These are words that should be underlined" ().
Rmarkdown knit pdf - getting underlined text instead of italic using *italic* (huxtable issue?)
From the TeXnical perspective the problem is that the ulem
package is loaded without the normalem
option. A couple of workarounds:
use
classoption: normalem
(based on Knitr hook to add code before \documentclass line in tex file to avoid options clash with xcolor). Caveat: this will pass the option to all packages and might be undesired in case the same option name is also used by other packages (I'm not aware of any other package that uses this option, but just in case ...)add
\normalem
either asheader-include
or at the start of your document
Can the PostbackUrl be set for a GridView CommandField?
Leppie is right. The GridView has no PostbackUrl property. However, you can do what you want by using a standard control, which has a PostbackUrl property.
<asp:TemplateField AccessibleHeaderText="Edit">
<ItemTemplate>
<asp:Button runat="server" ID="btnEdit" PostBackUrl="~/Default.aspx" OnClientClick='form1.ActivityId.value = this.Tag;' Tag='<%# Eval("ActivityId") %>' Text="Edit"/>
</ItemTemplate>
</asp:TemplateField>
In this sample code, I added a TemplateColumn to the GridView. I use a dynamically added Tag attribute for the button to pass the Id, then I use Javascript code to put the value in a hidden field, and then the button simply postsback to the page specified in the PostbackUrl property.
Related Topics
Rails Undefined Method 'Errors' for Nil:Nilclass in Simple_Form
Make Map Marker Direct Link Onclick for Gmaps4Rails
Ruby Net-Ssh Calling Bash Script with Interactive Prompts
How to Convert Timestamp with Ruby
Scope That Has Three Levels Deep Joins
I Want to Match All Punctuation in My Regexp Except Apostrophes. How to Do That in Ruby
Unexpected =>, Expecting '}' in Rspec Expect
How to Properly Create a Associated Record Just After the Associator Record Creation
Multiple Limit Condition in Mongodb
Heroku_Can't Upgrade to Cedar-14
Slicing of Arrays in Ruby Returns Different Result - Nil VS. Empty Array
Why Does the Script Affect Everything on My Rails 3 App Even When Cased in This Code
Regex to Remove the Webpage Part of a Url in Ruby