LINUX.ORG.RU

В [CODE] теряется первый пробел

 


0

0

Если внутри тега CODE в начале строки перед текстом стоит один пробел, он потеряется. 2 и больше сохраняются. Пример:

Без отступа
 Отступ 1 пробел
  Отступ 2 пробела
   Отступ 3 пробела
    Отступ 4 пробела
Это ошибка, или сделано намерено?

★★★★★

Ответ на: комментарий от maxcom
    // replacing spaces for   to keep indentation
    content = content.replaceAll("  ", "  ");
    content = content.replaceAll("  ", "  ");

ИМХО, заменяются двойные пробелы, одиночный не заменяется, т.е. в тексте он есть, но HTML «съедает» его при отображении.

sdio ★★★★★
()
Ответ на: комментарий от sdio

А если добавить после

// replacing spaces for   to keep indentation
content = content.replaceAll("  ", "  ");
content = content.replaceAll("  ", "  ");
строчку
content = content.replaceAll(" ", " ");

drakmail ★★★★
()
Ответ на: комментарий от drakmail

надо что-бы кто-нибудь это сделал и протестил что оно работает и ничего не ломает

maxcom ★★★★★
()
Ответ на: [BUG] от Deleted

да, там разбиение на параграфы совсем не нужно

maxcom ★★★★★
()
Ответ на: [BUG] от Deleted

пока захакал средствами CSS, надо будет нормально сделать как-нибудь

maxcom ★★★★★
()
Ответ на: комментарий от maxcom

Стало ещё хуже, теперь он съедает почти все переводы строк:

//  boost cstdint.hpp header file  ------------------------------------------//

//  (C) Copyright Beman Dawes 1999. 
//  (C) Copyright Jens Mauer 2001  
//  (C) Copyright John Maddock 2001 
//  Distributed under the Boost
//  Software License, Version 1.0. (See accompanying file
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/integer for documentation.

//  Revision History
//   31 Oct 01  use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.)
//   16 Apr 01  check LONGLONG_MAX when looking for "long long" (Jens Maurer)
//   23 Jan 01  prefer "long" over "int" for int32_t and intmax_t (Jens Maurer)
//   12 Nov 00  Merged <boost/stdint.h> (Jens Maurer)
//   23 Sep 00  Added INTXX_C macro support (John Maddock).
//   22 Sep 00  Better 64-bit support (John Maddock)
//   29 Jun 00  Reimplement to avoid including stdint.h within namespace boost
//    8 Aug 99  Initial version (Beman Dawes)


#ifndef BOOST_CSTDINT_HPP
#define BOOST_CSTDINT_HPP

#include <boost/config.hpp>


#ifdef BOOST_HAS_STDINT_H

// The following #include is an implementation artifact; not part of interface.
# ifdef __hpux
// HP-UX has a vaguely nice <stdint.h> in a non-standard location
#   include <inttypes.h>
#   ifdef __STDC_32_MODE__
      // this is triggered with GCC, because it defines __cplusplus < 199707L
#     define BOOST_NO_INT64_T
#   endif 
# elif defined(__FreeBSD__) || defined(__IBMCPP__)
#   include <inttypes.h>
# else
#   include <stdint.h>

// There is a bug in Cygwin two _C macros
#   if defined(__STDC_CONSTANT_MACROS) && defined(__CYGWIN__)
#     undef INTMAX_C
#     undef UINTMAX_C
#     define INTMAX_C(c) c##LL
#     define UINTMAX_C(c) c##ULL
#   endif

# endif

#ifdef __QNX__

// QNX (Dinkumware stdlib) defines these as non-standard names.
// Reflect to the standard names.

typedef ::intleast8_t int_least8_t;
typedef ::intfast8_t int_fast8_t;
typedef ::uintleast8_t uint_least8_t;
typedef ::uintfast8_t uint_fast8_t;

typedef ::intleast16_t int_least16_t;
typedef ::intfast16_t int_fast16_t;
typedef ::uintleast16_t uint_least16_t;
typedef ::uintfast16_t uint_fast16_t;

typedef ::intleast32_t int_least32_t;
typedef ::intfast32_t int_fast32_t;
typedef ::uintleast32_t uint_least32_t;
typedef ::uintfast32_t uint_fast32_t;

# ifndef BOOST_NO_INT64_T

...
=)

Deleted
()
Ответ на: комментарий от Deleted

Во. Теперь кажется более-менее нормально. Лишние пустые строки в начале и конце можно считать фичей =).

Deleted
()

В links работает.

question4 ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.