40

Sometimes a specific doctype is required to reproduce an issue. Currently it's not possible to specify a doctype for a Stack Snippet's html section. I've tried this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <title>Test</title>
  <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
  <p>First button has less height than the other two:</p>
  <a href="#" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> </a>
  <a href="#" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> &nbsp; </a>
  <a href="#" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Test</a>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>

That snippet actually needs the doctype for the issue to be reproducible. However, it renders as:

<!DOCTYPE html>
<html>
<head>
    <style>

    </style>
</head>
<body>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <title>Test</title>
  <!-- etc -->

I don't think there's any other way (yet) to do this (no input somewhere, which is the way jsfiddle does it, see the difference between html4 and html5), which is why I'm placing this feature request.

7
  • 1
    Why would you want to do that, though? What's the point? (honest question, asking what's the use case) Oct 6, 2014 at 12:15
  • 9
    I was about to ask why the first button in this fiddle vs this fiddle has a different height, and how to solve that. Without the specific differing doctypes the issue is not noticable. In other words, sometimes a situation is only visible with a specific doctype, and you may be stuck with that doctype, so in order to provide a repro as context for your question you need to be able to specify that doctype.
    – Jeroen
    Oct 6, 2014 at 12:20
  • 3
    Moderately exotic feature request though, sure enough. I didn't mean to file my feature-request as high-prio of course, but it's still probably good for the back log.
    – Jeroen
    Oct 6, 2014 at 12:21
  • Well, it somehow became the #2 popular feature request for snippets.
    – Scimonster
    Oct 7, 2014 at 19:01
  • The REP! Waarrghhh-om-nom-NOM! Oh wait I get no rep here. Pffrt why do I even post on meta....? ;-)
    – Jeroen
    Oct 7, 2014 at 19:26
  • I want to be able to choose a MIME type for stacksnippets...
    – Mr Lister
    Jul 9, 2016 at 15:02
  • @MrLister Interesting. Perhaps a new question? I'd hazard a guess it's slightly more difficult to build, or at least a different feature to the team. - Do you know any online playground that already has this feature?
    – Jeroen
    Jul 9, 2016 at 15:30

0

You must log in to answer this question.

Browse other questions tagged .