Simple markdown rendering There are several ways to create headers on posts on the Stack Exchange network. The format that's most commonly1 used on PPCG seems to be:

# Level one header
## Level two header
### Level three header


Note the space after the hash marks. Also, note that trailing hash marks are not included. 

Challenge:

Take a (possibly multiline) string as input, and output the string on the following format:


If the header is level 1, then output each letter 4-by-4 times
If the header is level 2, then output each letter 3-by-3 times
If the header is level 3, then output each letter 2-by-2 times
If a line is not a header then output it as it is.




To illustrate:

--- Level 1 ---
# Hello
--- Output---
HHHHeeeelllllllloooo    
HHHHeeeelllllllloooo
HHHHeeeelllllllloooo
HHHHeeeelllllllloooo

--- Level 2 ---
## A B C def
--- Output ---
AAA   BBB   CCC   dddeeefff
AAA   BBB   CCC   dddeeefff
AAA   BBB   CCC   dddeeefff

--- Level 3 ---
### PPCG!
--- Output---
PPPPCCGG!!
PPPPCCGG!!


Simple as that!



Rules:


You must support input over multiple lines. Using \n etc. for newlines is OK.


There won't be lines containing only a # followed by a single space

The output must be presented over multiple lines. You may not output \n instead of literal newlines.


Trailing spaces and newlines are OK.





Test cases:

Input and output are separated by a line of ....

# This is a text
with two different
### headers!
........................................................    
TTTThhhhiiiissss    iiiissss    aaaa    tttteeeexxxxtttt
TTTThhhhiiiissss    iiiissss    aaaa    tttteeeexxxxtttt
TTTThhhhiiiissss    iiiissss    aaaa    tttteeeexxxxtttt
TTTThhhhiiiissss    iiiissss    aaaa    tttteeeexxxxtttt
with two different
hheeaaddeerrss!!
hheeaaddeerrss!!




This input has
## trailing hash marks ##
#and a hash mark without a space after it.
........................................................    
This input has
tttrrraaaiiillliiinnnggg   hhhaaassshhh   mmmaaarrrkkksss   ######
tttrrraaaiiillliiinnnggg   hhhaaassshhh   mmmaaarrrkkksss   ######
tttrrraaaiiillliiinnnggg   hhhaaassshhh   mmmaaarrrkkksss   ######
#and hash marks without a space after it.




# This ## is ### strange
#### ###
........................................................
TTTThhhhiiiissss    ########    iiiissss    ############    ssssttttrrrraaaannnnggggeeee
TTTThhhhiiiissss    ########    iiiissss    ############    ssssttttrrrraaaannnnggggeeee
TTTThhhhiiiissss    ########    iiiissss    ############    ssssttttrrrraaaannnnggggeeee
TTTThhhhiiiissss    ########    iiiissss    ############    ssssttttrrrraaaannnnggggeeee
#### ###




Multiple


### newlines! # 
:)
........................................................    
Multiple


nneewwlliinneess!!  ##
nneewwlliinneess!!  ##
:)




Line with only a hash mark:
#
### ^ Like that!
........................................................    
Line with only a hash mark:
#
^^  LLiikkee  tthhaatt!!
^^  LLiikkee  tthhaatt!!




1: I haven't really checked, but I think it's true.
Stacked, 51 50 bytes

Saved 1 byte thanks to @RickHitchcock - golfed regex

['^(##?#?) (.+)'[\#'5\-@k CS k*k rep LF#`]3/mrepl]


Try it online!

Anonymous function that takes input from the stack and leaves it on the stack.

Explanation

['^(##?#?) (.+)'[\#'5\-@k CS k*k rep LF#`]3/mrepl]
[                                            mrepl]   perform multiline replacement
 '^(##?#?) (.+)'                                     regex matching headers
                [                        ]3/         on each match:
                 \#'                                   count number of hashes
                    5\-                                5 - (^)
                       @k                              set k to number of repetitions
                          CS                           convert the header to a char string
                             k*                        repeat each char `k` times
                               k rep                   repeat said string `k` times
                                     LF#`              join by linefeeds