# Default language for code snippets changed?

**URL:** <https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586>\
**Category:** Meta\
**Created:** [May 29, 2022, 8:45am UTC](https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586 "2022-05-29T08:45:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [May 29, 2022, 8:45am UTC](https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586/1 "2022-05-29T08:45:32Z")

</div>

I have just noticed that _raw_ ``` starts a block of code not interpreted as Fortran any more.

```auto
program main 
 character(len=*), parameter :: str="first part &
    & second part"
  print '(a)', str     
end program main
! outputs: first part second part

```

One has to explicitly start with ```fortran to get the proper output

```fortran
program main
 character(len=*),parameter :: str2="first line" // new_line('a') // "second &
    &line"
  print '(a)', str2
end program main

```

---

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [May 29, 2022, 10:43am UTC](https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586/2 "2022-05-29T10:43:48Z")

</div>

There is no default language as far as I can see, rather the language is guessed in case no hint or an unknown hint is provided, this heuristic depends very much on the enabled language and the implementation in the highlighting plugin. In most cases the snippets are correctly identified as Fortran, but not always.

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [May 29, 2022, 9:10pm UTC](https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586/3 "2022-05-29T21:10:23Z")

</div>

I see. As it has always worked (recognizing my Fortran snippets without a hint), I thought it was the default, which would not be a bad idea on a Fortran Discourse, anyway.  
BTW, what is the proper _hint_ for C snippets? The following gets properly prettyfied with just raw ``` but fails to do it either with `c` or `C` hint. Strange.

```auto
#include <stdio.h>
int i=1;
printf("%d\n",i);
while (i<5) { printf("%d\n",++i); }

```

---

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [May 29, 2022, 9:17pm UTC](https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586/4 "2022-05-29T21:17:50Z")

</div>

I think only `cpp` is enabled for highlighting at the moment. I enabled `c` as well now.

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [May 29, 2022, 10:00pm UTC](https://fortran-lang.discourse.group/t/default-language-for-code-snippets-changed/3586/5 "2022-05-29T22:00:37Z")

</div>

Thanks! I was using `cpp` for quite a while now, to highlight C snippets too.
