Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 180

Doesn't formatting tags inside a tag [duplicate]

$
0
0

Sometimes I write answers within the <pre>...</pre> tag to get more control over formatting the answers. Usually, I do this with the code-snippets, which may be required some emphasis.

In the below snippet, I want to emphasize the expression str(getattr(self, field.name)) and thus I wrote the answer as below,

<pre><code>class HelperClass:    def get_fields(self):        return [(field, <b>str(getattr(self, field.name))</b>) for field in self._meta.fields]</code></pre>

But, the bold formatting doesn't appear.

Enter image description here

Note: I/We can see the formatted code block in the "edit/preview mode"

Is this a bug? Or was this feature removed in some release?

References:

  1. Link to the specific SO answer

Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>